Skip to content

Commit 45dac13

Browse files
YuuoniyAbhinav Kumar
authored andcommitted
drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path
of_icc_get() alloc resources for path1, we should release it when not need anymore. Early return when IS_ERR_OR_NULL(path0) may leak path1. Defer getting path1 to fix this. Fixes: b9364ee ("drm/msm/dpu: Move min BW request and full BW disable back to mdss") Signed-off-by: Miaoqian Lin <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/514264/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent e5266ca commit 45dac13

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/gpu/drm/msm/msm_mdss.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,17 @@ struct msm_mdss {
4747
static int msm_mdss_parse_data_bus_icc_path(struct device *dev,
4848
struct msm_mdss *msm_mdss)
4949
{
50-
struct icc_path *path0 = of_icc_get(dev, "mdp0-mem");
51-
struct icc_path *path1 = of_icc_get(dev, "mdp1-mem");
50+
struct icc_path *path0;
51+
struct icc_path *path1;
5252

53+
path0 = of_icc_get(dev, "mdp0-mem");
5354
if (IS_ERR_OR_NULL(path0))
5455
return PTR_ERR_OR_ZERO(path0);
5556

5657
msm_mdss->path[0] = path0;
5758
msm_mdss->num_paths = 1;
5859

60+
path1 = of_icc_get(dev, "mdp1-mem");
5961
if (!IS_ERR_OR_NULL(path1)) {
6062
msm_mdss->path[1] = path1;
6163
msm_mdss->num_paths++;

0 commit comments

Comments
 (0)