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

Commit 120427c6 authored by Gaurav Kohli's avatar Gaurav Kohli Committed by Puja Gupta
Browse files

soc: qcom: Use syncronization while freeing the qmi_client data



Potential use after free possibility when trying to access qmi client
data in the ssr notification and root pd_down notification handling.

CRs-Fixed: 1074483
Change-Id: I5390810861dbc1da368757df2b20e5daa35bd081
Signed-off-by: default avatarGaurav Kohli <gkohli@codeaurora.org>
parent 057bdafd
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -114,6 +114,7 @@ struct qmi_client_info {
};
static LIST_HEAD(qmi_client_list);
static DEFINE_MUTEX(qmi_list_lock);
static DEFINE_MUTEX(qmi_client_release_lock);

static DEFINE_MUTEX(notif_add_lock);

@@ -417,9 +418,11 @@ static void root_service_service_exit(struct qmi_client_info *data,
	 * Destroy client handle and try connecting when
	 * service comes up again.
	 */
	mutex_lock(&qmi_client_release_lock);
	data->service_connected = false;
	qmi_handle_destroy(data->clnt_handle);
	data->clnt_handle = NULL;
	mutex_unlock(&qmi_client_release_lock);
}

static void root_service_exit_work(struct work_struct *work)