Skip to content

Commit

Permalink
Merge "diag: Prevent using uninitialized mdlog session mask"
Browse files Browse the repository at this point in the history
  • Loading branch information
qctecmdr authored and Gerrit - the friendly Code Review server committed Jul 3, 2019
2 parents a92c2f5 + c7a160e commit d05a251
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions drivers/char/diag/diagchar_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ void diag_clear_masks(int pid)
static void diag_close_logging_process(const int pid)
{
int i, j;
int session_mask;
int session_mask = 0;
int device_mask = 0;
uint32_t p_mask;
struct diag_md_session_t *session_info = NULL;
Expand All @@ -473,8 +473,9 @@ static void diag_close_logging_process(const int pid)
diag_clear_masks(pid);

mutex_lock(&driver->diagchar_mutex);
p_mask =
diag_translate_kernel_to_user_mask(session_mask);
if (session_mask)
p_mask =
diag_translate_kernel_to_user_mask(session_mask);

for (i = 0; i < NUM_MD_SESSIONS; i++)
if (MD_PERIPHERAL_MASK(i) & session_mask)
Expand Down

0 comments on commit d05a251

Please sign in to comment.