[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CABnWg9sy_u5+TRvuRXEN8FB8BGdSadYimUQ-R6=PYEKZn2RZRw@mail.gmail.com>
Date: Thu, 14 Sep 2023 13:38:43 +0000
From: Guillaume Ranquet <granquet@...libre.com>
To: Jani Nikula <jani.nikula@...el.com>,
dri-devel@...ts.freedesktop.org
Cc: 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: Re: [PATCH] drm/mediatek/dp: fix memory leak on ->get_edid callback
error path
On Thu, 14 Sep 2023 15:10, Jani Nikula <jani.nikula@...el.com> wrote:
>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>
>
Reviewed-by: Guillaume Ranquet <granquet@...libre.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