mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-12 12:30:08 +00:00
tools: acrntrace: fix a variable uninitialized issue
'err' may be used uninitialized and be dereferenced NULL. This commit fix the reported issue via initializing 'err' to 0, and return 'err' at the end of the func. Tracked-On: #1157 Signed-off-by: Yan, Like <like.yan@intel.com>
This commit is contained in:
@@ -154,7 +154,7 @@ static int get_cpu_num(void)
|
||||
|
||||
static int create_trace_file_dir(char *dir)
|
||||
{
|
||||
int err;
|
||||
int err = 0;
|
||||
char cmd[CMD_MAX_LEN];
|
||||
char time_str[TIME_STR_LEN];
|
||||
time_t timep;
|
||||
@@ -193,7 +193,7 @@ static int create_trace_file_dir(char *dir)
|
||||
|
||||
pr_dbg("dir %s creted\n", dir);
|
||||
|
||||
return WIFEXITED(err) ? WEXITSTATUS(err) : EXIT_FAILURE;
|
||||
return err;
|
||||
}
|
||||
|
||||
/* function executed in each consumer thread */
|
||||
|
Reference in New Issue
Block a user