OSDN Git Service

soc: qcom: service-locator: Free memory in case of error
authorSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Thu, 23 Mar 2017 02:07:12 +0000 (19:07 -0700)
committerSatya Durga Srinivasu Prabhala <satyap@codeaurora.org>
Thu, 23 Mar 2017 02:09:04 +0000 (19:09 -0700)
Free previously allocated memory in case of error to avoid
memory leak.

CRs-Fixed: 2022322
Change-Id: I297bd6ee1d75c039cacf8409b324c119f1b86875
Signed-off-by: Satya Durga Srinivasu Prabhala <satyap@codeaurora.org>
drivers/soc/qcom/service-locator.c

index 0d6c1d6..5ac2a58 100644 (file)
@@ -375,6 +375,7 @@ int get_service_location(char *client_name, char *service_name,
        if (!pqw) {
                rc = -ENOMEM;
                pr_err("Allocation failed\n");
+               kfree(pqcd);
                goto err;
        }
        pqw->notifier = locator_nb;