From f90fbfe1c57e4352b2deffdb569ff33705921029 Mon Sep 17 00:00:00 2001 From: Puja Gupta Date: Fri, 14 Oct 2016 17:35:51 -0700 Subject: [PATCH] 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 --- drivers/soc/qcom/service-notifier.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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,