Skip to content

Commit

Permalink
msm: msm_bus: Fix memory leak during RPM transaction
Browse files Browse the repository at this point in the history
This is a serious bug that eventually cripples the system due to
lost memory.

CRs-Fixed: 442381
Change-Id: If4d33b35475a33b1602a1d923031345b47af963e
Signed-off-by: Michael Bohan <mbohan@codeaurora.org>
Signed-off-by: Sana Venkat Raju <c_vsana@codeaurora.org>
  • Loading branch information
Michael Bohan authored and invisiblek committed Oct 8, 2014
1 parent c0c962c commit d44bdd3
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions arch/arm/mach-msm/msm_bus/msm_bus_rpm_smd.c
@@ -1,4 +1,4 @@
/* Copyright (c) 2012, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2014, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
Expand Down Expand Up @@ -101,7 +101,7 @@ static int msm_bus_rpm_req(int ctx, uint32_t rsc_type, uint32_t key,
if (ret) {
MSM_BUS_WARN("RPM: Add KVP failed for RPM Req:%u\n",
rsc_type);
return ret;
goto free_rpm_request;
}

MSM_BUS_DBG("Added Key: %d, Val: %llu, size: %d\n", key,
Expand All @@ -112,22 +112,26 @@ static int msm_bus_rpm_req(int ctx, uint32_t rsc_type, uint32_t key,
if (ret) {
MSM_BUS_WARN("RPM: Add KVP failed for RPM Req:%u\n",
rsc_type);
return ret;
goto free_rpm_request;
}
}

msg_id = msm_rpm_send_request(rpm_req);
if (!msg_id) {
MSM_BUS_WARN("RPM: No message ID for req\n");
return -ENXIO;
ret = -ENXIO;
goto free_rpm_request;
}

ret = msm_rpm_wait_for_ack(msg_id);
if (ret) {
MSM_BUS_WARN("RPM: Ack failed\n");
return ret;
goto free_rpm_request;
}

free_rpm_request:
msm_rpm_free_request(rpm_req);

return ret;
}

Expand Down

0 comments on commit d44bdd3

Please sign in to comment.