summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@quicinc.com>2017-05-16 06:49:24 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-05-16 06:49:23 -0700
commit84b6f80caba5ae80e63fb48b8783a086228ee91e (patch)
tree6786bd7592b01acc54474dd423566916d01f4eaf
parent3a168d290babaa453c1e0fd8f5f2d417599ce044 (diff)
parentb57f957da32225f88d2134ed80aaa6ebf3326fda (diff)
Merge "memshare: Update the free memory count after allocation"
-rw-r--r--drivers/soc/qcom/memshare/msm_memshare.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/soc/qcom/memshare/msm_memshare.c b/drivers/soc/qcom/memshare/msm_memshare.c
index c11114528d2a..7406dba44320 100644
--- a/drivers/soc/qcom/memshare/msm_memshare.c
+++ b/drivers/soc/qcom/memshare/msm_memshare.c
@@ -524,10 +524,6 @@ static int handle_alloc_generic_req(void *req_h, void *req, void *conn_h)
return -EINVAL;
}
- memblock[client_id].free_memory += 1;
- pr_debug("memshare: In %s, free memory count for client id: %d = %d",
- __func__, memblock[client_id].client_id,
- memblock[client_id].free_memory);
if (!memblock[client_id].alloted) {
if (alloc_req->client_id == 1 && alloc_req->num_bytes > 0)
size = alloc_req->num_bytes + MEMSHARE_GUARD_BYTES;
@@ -541,11 +537,16 @@ static int handle_alloc_generic_req(void *req_h, void *req, void *conn_h)
resp = 1;
}
if (!resp) {
+ memblock[client_id].free_memory += 1;
memblock[client_id].alloted = 1;
memblock[client_id].size = alloc_req->num_bytes;
memblock[client_id].peripheral = alloc_req->proc_id;
}
}
+ pr_debug("memshare: In %s, free memory count for client id: %d = %d",
+ __func__, memblock[client_id].client_id,
+ memblock[client_id].free_memory);
+
memblock[client_id].sequence_id = alloc_req->sequence_id;
fill_alloc_response(alloc_resp, client_id, &resp);