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

Commit a801ad8f authored by Meng Wang's avatar Meng Wang Committed by Gerrit - the friendly Code Review server
Browse files

dsp: lsm: move lsm_common deregister out of mutex_lock



When dispatch_event in apr and q6lsm_client_free in q6lsm
are running concurrently, there may be deadlock between
session_lock in lsm and svc->m_lock in apr for lsm_common.
Move lsm_common mmap apr deregister out of mutex_lock to
avoid deadlock.

Change-Id: I7c96ba12834bd4a7c8e5ca1b78d798578678b251
Signed-off-by: default avatarMeng Wang <mengw@codeaurora.org>
parent f1385241
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -376,10 +376,10 @@ void q6lsm_client_free(struct lsm_client *client)
		return;
	}
	apr_deregister(client->apr);
	q6lsm_mmap_apr_dereg();
	client->mmap_apr = NULL;
	mutex_lock(&session_lock);
	q6lsm_session_free(client);
	q6lsm_mmap_apr_dereg();
	mutex_destroy(&client->cmd_lock);
	kfree(client);
	client = NULL;