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

Commit da5dcaf7 authored by Hardik Arya's avatar Hardik Arya
Browse files

diag: Update hdlc disable protection to avoid deadlock



Currently there is a possibility of deadlock while processing
apps data. The patch updates the scope of hdlc_disable_mutex
to avoid the deadlock situation.

Change-Id: I070e1a546a016fdd854ad413c03c0bc6f192c516
Signed-off-by: default avatarHardik Arya <harya@codeaurora.org>
parent 4ef2d895
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2903,13 +2903,13 @@ static int diag_user_process_apps_data(const char __user *buf, int len,
	else
		hdlc_disabled = driver->hdlc_disabled;
	mutex_unlock(&driver->md_session_lock);
	mutex_unlock(&driver->hdlc_disable_mutex);
	if (hdlc_disabled)
		ret = diag_process_apps_data_non_hdlc(user_space_data, len,
						      pkt_type);
	else
		ret = diag_process_apps_data_hdlc(user_space_data, len,
						  pkt_type);
	mutex_unlock(&driver->hdlc_disable_mutex);
	mutex_unlock(&apps_data_mutex);

	diagmem_free(driver, user_space_data, mempool);