Skip to content

Commit

Permalink
Fix for Coverity issues for crashlog
Browse files Browse the repository at this point in the history
This patch fixes few coverity issues for log_capture

Tests Done: Build and boot

Tracked-On: OAM-124424
Signed-off-by: Tanuj Tekriwal <[email protected]>
  • Loading branch information
tanujtekriwal committed Sep 6, 2024
1 parent 6243157 commit 0bac094
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crashlog/crashutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ unsigned long long get_uptime(int refresh, int *error)
}

// Find system last kmsg from dropbox
static int find_system_last_kmsg(char source[], int source_length) {
static int find_system_last_kmsg(char *source, int source_length) {
struct dirent *entry;
DIR *dir = opendir(DROPBOX_DIR);
int file_exist = 0;
Expand All @@ -183,6 +183,7 @@ static int find_system_last_kmsg(char source[], int source_length) {
}
}
}
closedir(dir);
return file_exist;
}

Expand All @@ -205,7 +206,7 @@ void do_last_kmsg_copy(char *dir) {
snprintf(destion, sizeof(destion), "%s/%s", dir, FTRACE_RAMOOPS_FILE);
do_copy_tail(FTRACE_RAMOOPS, destion, MAXFILESIZE);
}
if (find_system_last_kmsg(source, sizeof(source))) {
if (find_system_last_kmsg(&source, sizeof(source))) {
snprintf(destion, sizeof(destion), "%s/%s", dir, source);
snprintf(sourcepath, sizeof(sourcepath), "%s/%s", DROPBOX_DIR, source);
do_copy_tail(sourcepath, destion, MAXFILESIZE);
Expand Down

0 comments on commit 0bac094

Please sign in to comment.