summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSultanxda <sultanxda@gmail.com>2017-09-26 21:35:34 +0200
committerMichael Bestas <mkbestas@gmail.com>2020-04-18 04:02:31 +0300
commit39825fd47718456a91767000531f76144496c8e7 (patch)
tree002bbfc9a476c693ac49acec43e8adb4c3b968f9
parent5c268723ead051192652888914d352c9fff2bc98 (diff)
mdss: livedisplay: Fix memory leaks in mdss_livedisplay_update()
parse_dsi_cmds() allocates two blocks of memory and stores their addresses in a stack-allocated variable, but they are never freed, so when the function exits, all references to them are gone. Free the allocated memory after using it in order to fix the memory leaks. Change-Id: Ie574848e2429167fc38ed39975feb3df68ed2aed Signed-off-by: Sultanxda <sultanxda@gmail.com>
-rw-r--r--drivers/video/fbdev/msm/mdss_livedisplay.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/fbdev/msm/mdss_livedisplay.c b/drivers/video/fbdev/msm/mdss_livedisplay.c
index d1c86dbcfbb4..90d18572166e 100644
--- a/drivers/video/fbdev/msm/mdss_livedisplay.c
+++ b/drivers/video/fbdev/msm/mdss_livedisplay.c
@@ -247,6 +247,8 @@ int mdss_livedisplay_update(struct mdss_dsi_ctrl_pdata *ctrl_pdata,
if (ret == 0) {
mdss_dsi_panel_cmds_send(ctrl_pdata, &dsi_cmds,
CMD_REQ_COMMIT | CMD_CLK_CTRL);
+ kfree(dsi_cmds.buf);
+ kfree(dsi_cmds.cmds);
} else {
pr_err("%s: error parsing DSI command! ret=%d", __func__, ret);
}