Skip to content

Commit fcaf976

Browse files
jnikulaChun-Kuang Hu
authored andcommitted
drm/mediatek/dp: fix memory leak on ->get_edid callback error path
Setting new_edid to NULL leaks the buffer. Fixes: f70ac09 ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann <msp@baylibre.com> Cc: Guillaume Ranquet <granquet@baylibre.com> Cc: Bo-Chen Chen <rex-bc.chen@mediatek.com> Cc: CK Hu <ck.hu@mediatek.com> Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Cc: Dmitry Osipenko <dmitry.osipenko@collabora.com> Cc: Chun-Kuang Hu <chunkuang.hu@kernel.org> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Matthias Brugger <matthias.bgg@gmail.com> Cc: dri-devel@lists.freedesktop.org Cc: linux-mediatek@lists.infradead.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: <stable@vger.kernel.org> # v6.1+ Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-by: Guillaume Ranquet <granquet@baylibre.com> Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nikula@intel.com/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
1 parent dab12fa commit fcaf976

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/gpu/drm/mediatek/mtk_dp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2063,6 +2063,7 @@ static struct edid *mtk_dp_get_edid(struct drm_bridge *bridge,
20632063
*/
20642064
if (mtk_dp_parse_capabilities(mtk_dp)) {
20652065
drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n");
2066+
kfree(new_edid);
20662067
new_edid = NULL;
20672068
}
20682069

0 commit comments

Comments
 (0)