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: Vidyakumar Athota <vathota@codeaurora.org>
This commit is contained in:
parent
0c56067b68
commit
0b9c8c186f
1 changed files with 1 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue