diff options
| author | Puja Gupta <pujag@codeaurora.org> | 2016-10-14 17:35:51 -0700 |
|---|---|---|
| committer | Puja Gupta <pujag@codeaurora.org> | 2016-10-17 12:04:27 -0700 |
| commit | f90fbfe1c57e4352b2deffdb569ff33705921029 (patch) | |
| tree | 1ca86d4971bd9867f2d32e800f3dc7646d9852f2 | |
| parent | 4f983fd1aa1ae7640ddaff7e4838f9f04f3e263f (diff) | |
soc: qcom: Acquire mutex before checking for service
Acquire lock before you check if the service exist. This leads to
race condition where you end up adding same service multiple times
in service_list and make multiple registration request to servreg.
CRs-Fixed: 1078753
Change-Id: I8ae92ee1d26bd6687b6b2b4cbed1032485d7450e
Signed-off-by: Puja Gupta <pujag@codeaurora.org>
| -rw-r--r-- | drivers/soc/qcom/service-notifier.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/soc/qcom/service-notifier.c b/drivers/soc/qcom/service-notifier.c index 504a3263253c..ab00eac7f633 100644 --- a/drivers/soc/qcom/service-notifier.c +++ b/drivers/soc/qcom/service-notifier.c @@ -605,8 +605,8 @@ void *service_notif_register_notifier(const char *service_path, int instance_id, if (!service_path || !instance_id || !nb) return ERR_PTR(-EINVAL); - service_notif = _find_service_info(service_path); mutex_lock(¬if_add_lock); + service_notif = _find_service_info(service_path); if (!service_notif) { service_notif = (struct service_notif_info *)add_service_notif( service_path, |
