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

Commit 0b9c8c18 authored by Vidyakumar Athota's avatar Vidyakumar Athota
Browse files

apr: fix race condition in apr reset



Since apr reset is scheduled in a workqueue, it is possible that before
completion of previous session apr_deregister(), new session of apr_register()
can happen in ssr scenario. Some of the variables are not reset properly
due to this race condition. Fix this issue by failing apr_register() till
apr_deregister() is completed.

Change-Id: I203e356e8330d8633d78bbfc6ae0165afa79f1f3
Signed-off-by: default avatarVidyakumar Athota <vathota@codeaurora.org>
parent 0c56067b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -543,6 +543,7 @@ struct apr_svc *apr_register(char *dest, char *svc_name, apr_fn svc_fn,
	if (svc->need_reset) {
		mutex_unlock(&svc->m_lock);
		pr_err("APR: Service needs reset\n");
		svc = NULL;
		goto done;
	}
	svc->id = svc_id;