drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path
authorMiaoqian Lin <linmq006@gmail.com>
Wed, 7 Dec 2022 06:59:22 +0000 (10:59 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:23 +0000 (11:58 +0100)
commitc6fa1de83fd87267ab24359e6fa52f98f5cee3f9
tree97f42924b100ff60962365af5c46d430d3e0a000
parent7928737dd1498bc365068d766ccf4eaeaff8ddf4
drm/msm/dpu: Fix memory leak in msm_mdss_parse_data_bus_icc_path

[ Upstream commit 45dac1352b55b1d8cb17f218936b2bc2bc1fb4ee ]

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: b9364eed9232 ("drm/msm/dpu: Move min BW request and full BW disable back to mdss")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/514264/
Link: https://lore.kernel.org/r/20221207065922.2086368-1-linmq006@gmail.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/msm/msm_mdss.c