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

Commit 078824f1 authored by Sreelakshmi Gownipalli's avatar Sreelakshmi Gownipalli Committed by Chris Lew
Browse files

diag: Prevent NULL pointer dereference while closing logging process



Prevent NULL pointer dereference while copying the data to memory device
process by adding mutex protection when closing the process.

Change-Id: Idaad73fb8b2a0bb5a4983d5e255bfdf702cecf71
Signed-off-by: default avatarSreelakshmi Gownipalli <sgownipa@codeaurora.org>
parent d9b3b62e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -439,8 +439,10 @@ static void diag_close_logging_process(const int pid)
	driver->mask_clear = 1;
	mutex_unlock(&driver->diag_maskclear_mutex);

	mutex_lock(&driver->diagchar_mutex);
	session_peripheral_mask = session_info->peripheral_mask;
	diag_md_session_close(session_info);
	mutex_unlock(&driver->diagchar_mutex);
	for (i = 0; i < NUM_MD_SESSIONS; i++)
		if (MD_PERIPHERAL_MASK(i) & session_peripheral_mask)
			diag_mux_close_peripheral(DIAG_LOCAL_PROC, i);