[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230914155317.2511876-1-jani.nikula@intel.com>
Date: Thu, 14 Sep 2023 18:53:17 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: Jani Nikula <jani.nikula@...el.com>,
dri-devel@...ts.freedesktop.org
Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Guillaume Ranquet <granquet@...libre.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org,
Markus Schneider-Pargmann <msp@...libre.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Dmitry Osipenko <dmitry.osipenko@...labora.com>,
Bo-Chen Chen <rex-bc.chen@...iatek.com>,
linux-mediatek@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Philipp Zabel <p.zabel@...gutronix.de>
Subject: [PATCH] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection
The sads returned by drm_edid_to_sad() needs to be freed.
Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195")
Cc: Guillaume Ranquet <granquet@...libre.com>
Cc: Bo-Chen Chen <rex-bc.chen@...iatek.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
Cc: Dmitry Osipenko <dmitry.osipenko@...labora.com>
Cc: Chun-Kuang Hu <chunkuang.hu@...nel.org>
Cc: Philipp Zabel <p.zabel@...gutronix.de>
Cc: Matthias Brugger <matthias.bgg@...il.com>
Cc: dri-devel@...ts.freedesktop.org
Cc: linux-mediatek@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org
Cc: <stable@...r.kernel.org> # v6.1+
Signed-off-by: Jani Nikula <jani.nikula@...el.com>
---
Found another one. UNTESTED.
---
drivers/gpu/drm/mediatek/mtk_dp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 8fc6eff68e30..0e285df6577e 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2034,7 +2034,6 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
bool enabled = mtk_dp->enabled;
struct edid *new_edid = NULL;
struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg;
- struct cea_sad *sads;
if (!enabled) {
drm_atomic_bridge_chain_pre_enable(bridge, connector->state->state);
@@ -2054,7 +2053,11 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
}
if (new_edid) {
+ struct cea_sad *sads;
+
audio_caps->sad_count = drm_edid_to_sad(new_edid, &sads);
+ kfree(sads);
+
audio_caps->detect_monitor = drm_detect_monitor_audio(new_edid);
}
--
2.39.2
Powered by blists - more mailing lists