Unverified Commit a063cb8e authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11719 rtla/osnoise: Prevent NULL dereference in error handling

parents e7d34f92 b85114fc
Loading
Loading
Loading
Loading
+4 −7
Original line number Diff line number Diff line
@@ -624,8 +624,10 @@ struct osnoise_tool *osnoise_init_top(struct osnoise_top_params *params)
		return NULL;

	tool->data = osnoise_alloc_top(nr_cpus);
	if (!tool->data)
		goto out_err;
	if (!tool->data) {
		osnoise_destroy_tool(tool);
		return NULL;
	}

	tool->params = params;

@@ -633,11 +635,6 @@ struct osnoise_tool *osnoise_init_top(struct osnoise_top_params *params)
				   osnoise_top_handler, NULL);

	return tool;

out_err:
	osnoise_free_top(tool->data);
	osnoise_destroy_tool(tool);
	return NULL;
}

static int stop_tracing;