Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cd35d9b8 authored by Manoj Prabhu B's avatar Manoj Prabhu B
Browse files

diag: Prevent using uninitialized mdlog session mask



Add check to prevent using uninitialized session mask to translate
kernel to user mask. Also remove unused macro definition for SMUX.

Change-Id: I341f0308775a2c5a00856fe6ec8acf9b63e207d9
Signed-off-by: default avatarManoj Prabhu B <bmanoj@codeaurora.org>
parent d16a6408
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -322,8 +322,7 @@ enum remote_procs {
#define DIAG_MD_BRIDGE_BASE	DIAG_MD_LOCAL_LAST
#define DIAG_MD_MDM		(DIAG_MD_BRIDGE_BASE)
#define DIAG_MD_MDM2		(DIAG_MD_BRIDGE_BASE + 1)
#define DIAG_MD_SMUX		(DIAG_MD_BRIDGE_BASE + 2)
#define DIAG_MD_BRIDGE_LAST	(DIAG_MD_BRIDGE_BASE + 3)
#define DIAG_MD_BRIDGE_LAST	(DIAG_MD_BRIDGE_BASE + 2)

#ifndef CONFIG_DIAGFWD_BRIDGE_CODE
#define NUM_DIAG_MD_DEV		DIAG_MD_LOCAL_LAST
+4 −3
Original line number Diff line number Diff line
@@ -453,7 +453,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;
@@ -492,6 +492,7 @@ static void diag_close_logging_process(const int pid)
		diag_clear_masks(pid);

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