[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230914131058.2472260-1-jani.nikula@intel.com>
Date: Thu, 14 Sep 2023 16:10:58 +0300
From: Jani Nikula <jani.nikula@...el.com>
To: dri-devel@...ts.freedesktop.org
Cc: jani.nikula@...el.com,
Markus Schneider-Pargmann <msp@...libre.com>,
Guillaume Ranquet <granquet@...libre.com>,
Bo-Chen Chen <rex-bc.chen@...iatek.com>,
CK Hu <ck.hu@...iatek.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>,
Dmitry Osipenko <dmitry.osipenko@...labora.com>,
Chun-Kuang Hu <chunkuang.hu@...nel.org>,
Philipp Zabel <p.zabel@...gutronix.de>,
Matthias Brugger <matthias.bgg@...il.com>,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, stable@...r.kernel.org
Subject: [PATCH] drm/mediatek/dp: fix memory leak on ->get_edid callback error path
Setting new_edid to NULL leaks the buffer.
Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Cc: Markus Schneider-Pargmann <msp@...libre.com>
Cc: Guillaume Ranquet <granquet@...libre.com>
Cc: Bo-Chen Chen <rex-bc.chen@...iatek.com>
Cc: CK Hu <ck.hu@...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>
---
UNTESTED
---
drivers/gpu/drm/mediatek/mtk_dp.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c
index 2cb47f663756..8fc6eff68e30 100644
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2049,6 +2049,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
*/
if (mtk_dp_parse_capabilities(mtk_dp)) {
drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n");
+ kfree(new_edid);
new_edid = NULL;
}
--
2.39.2
Powered by blists - more mailing lists