6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Jani Nikula <jani.nik...@intel.com>

commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc upstream.

Setting new_edid to NULL leaks the buffer.

Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver")
Cc: Markus Schneider-Pargmann <m...@baylibre.com>
Cc: Guillaume Ranquet <granq...@baylibre.com>
Cc: Bo-Chen Chen <rex-bc.c...@mediatek.com>
Cc: CK Hu <ck...@mediatek.com>
Cc: AngeloGioacchino Del Regno <angelogioacchino.delre...@collabora.com>
Cc: Dmitry Osipenko <dmitry.osipe...@collabora.com>
Cc: Chun-Kuang Hu <chunkuang...@kernel.org>
Cc: Philipp Zabel <p.za...@pengutronix.de>
Cc: Matthias Brugger <matthias....@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-media...@lists.infradead.org
Cc: linux-ker...@vger.kernel.org
Cc: linux-arm-ker...@lists.infradead.org
Cc: <sta...@vger.kernel.org> # v6.1+
Signed-off-by: Jani Nikula <jani.nik...@intel.com>
Reviewed-by: Guillaume Ranquet <granq...@baylibre.com>
Link: 
https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nik...@intel.com/
Signed-off-by: Chun-Kuang Hu <chunkuang...@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gre...@linuxfoundation.org>
---
 drivers/gpu/drm/mediatek/mtk_dp.c |    1 +
 1 file changed, 1 insertion(+)

--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -2048,6 +2048,7 @@ static struct edid *mtk_dp_get_edid(stru
         */
        if (mtk_dp_parse_capabilities(mtk_dp)) {
                drm_err(mtk_dp->drm_dev, "Can't parse capabilities\n");
+               kfree(new_edid);
                new_edid = NULL;
        }
 


Reply via email to