summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmir Samuelov <amirs@codeaurora.org>2017-08-27 16:02:03 +0300
committerGerrit - the friendly Code Review server <code-review@localhost>2017-08-28 06:10:40 -0700
commitdf572ff0bc8b2b8911366ec708912da6802ca455 (patch)
treefbad3bbd24c382248585a00b376dd6420c95cdfe
parent8aedd7084222d4cce3acdfe3c71820c674503bee (diff)
spcom: fix memory leak in spcom register client / register service API
free allocated memory in error handling of spcom_register_client() and spcom_register_service() kernel API. Change-Id: Ieb5787cb1a11d4b3320237fa8cdde3dc357d9084 Signed-off-by: Amir Samuelov <amirs@codeaurora.org>
-rw-r--r--drivers/soc/qcom/spcom.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/soc/qcom/spcom.c b/drivers/soc/qcom/spcom.c
index bf89cb63ce4a..6c1e781d6eb9 100644
--- a/drivers/soc/qcom/spcom.c
+++ b/drivers/soc/qcom/spcom.c
@@ -1138,6 +1138,7 @@ struct spcom_client *spcom_register_client(struct spcom_client_info *info)
ch = spcom_find_channel_by_name(name);
if (!ch) {
pr_err("channel %s doesn't exist, load App first.\n", name);
+ kfree(client);
return NULL;
}
@@ -1325,6 +1326,7 @@ struct spcom_server *spcom_register_service(struct spcom_service_info *info)
ch = spcom_find_channel_by_name(name);
if (!ch) {
pr_err("channel %s doesn't exist, load App first.\n", name);
+ kfree(server);
return NULL;
}