summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-30 06:28:09 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-30 06:28:09 -0800
commit915216e93d7c1109073bcf804eebcaefa927f389 (patch)
tree662df630126fea43a71c8b7bb553724bead939d3
parent89344f71471777bc46f2c6e30b474a4d719b892f (diff)
parentec046f26ddfcfce4709f457d60972f1b3618ceb5 (diff)
Merge "memshare: Fix possible memory leak"
-rw-r--r--drivers/soc/qcom/memshare/msm_memshare.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/soc/qcom/memshare/msm_memshare.c b/drivers/soc/qcom/memshare/msm_memshare.c
index d263b461deb5..5726c3277456 100644
--- a/drivers/soc/qcom/memshare/msm_memshare.c
+++ b/drivers/soc/qcom/memshare/msm_memshare.c
@@ -510,6 +510,8 @@ static int handle_alloc_generic_req(void *req_h, void *req, void *conn_h)
pr_err("memshare: %s client not found, requested client: %d, proc_id: %d\n",
__func__, alloc_req->client_id,
alloc_req->proc_id);
+ kfree(alloc_resp);
+ alloc_resp = NULL;
return -EINVAL;
}
@@ -554,6 +556,9 @@ static int handle_alloc_generic_req(void *req_h, void *req, void *conn_h)
if (rc < 0)
pr_err("In %s, Error sending the alloc request: %d\n",
__func__, rc);
+
+ kfree(alloc_resp);
+ alloc_resp = NULL;
return rc;
}
@@ -671,6 +676,8 @@ static int handle_query_size_req(void *req_h, void *req, void *conn_h)
pr_err("memshare: %s client not found, requested client: %d, proc_id: %d\n",
__func__, query_req->client_id,
query_req->proc_id);
+ kfree(query_resp);
+ query_resp = NULL;
return -EINVAL;
}
@@ -696,6 +703,8 @@ static int handle_query_size_req(void *req_h, void *req, void *conn_h)
pr_err("In %s, Error sending the query request: %d\n",
__func__, rc);
+ kfree(query_resp);
+ query_resp = NULL;
return rc;
}