Patch "drm/mediatek/dp: fix memory leak on ->get_edid callback error path" has been added to the 6.6-stable tree
This is a note to let you know that I've just added the patch titled drm/mediatek/dp: fix memory leak on ->get_edid callback error path to the 6.6-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch and it can be found in the queue-6.6 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 14 Sep 2023 16:10:58 +0300 Subject: drm/mediatek/dp: fix memory leak on ->get_edid callback error path From: Jani Nikula commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc upstream. Setting new_edid to NULL leaks the buffer. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger 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: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Guillaume Ranquet Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nik...@intel.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- 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; } Patches currently in stable-queue which might be from jani.nik...@intel.com are queue-6.6/drm-msm-dp-skip-validity-check-for-dp-cts-edid-check.patch queue-6.6/i915-perf-fix-null-deref-bugs-with-drm_dbg-calls.patch queue-6.6/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch queue-6.6/drm-edid-fixup-h-vsync_end-instead-of-h-vtotal.patch queue-6.6/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-audio-detection.patch queue-6.6/drm-i915-mtl-avoid-stringop-overflow-warning.patch queue-6.6/drm-i915-tc-fix-wformat-truncation-in-intel_tc_port_.patch
Patch "drm/mediatek/dp: fix memory leak on ->get_edid callback error path" has been added to the 6.5-stable tree
This is a note to let you know that I've just added the patch titled drm/mediatek/dp: fix memory leak on ->get_edid callback error path to the 6.5-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch and it can be found in the queue-6.5 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 14 Sep 2023 16:10:58 +0300 Subject: drm/mediatek/dp: fix memory leak on ->get_edid callback error path From: Jani Nikula commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc upstream. Setting new_edid to NULL leaks the buffer. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger 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: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Guillaume Ranquet Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nik...@intel.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- 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 @@ -2005,6 +2005,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; } Patches currently in stable-queue which might be from jani.nik...@intel.com are queue-6.5/drm-msm-dp-skip-validity-check-for-dp-cts-edid-check.patch queue-6.5/i915-perf-fix-null-deref-bugs-with-drm_dbg-calls.patch queue-6.5/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch queue-6.5/drm-edid-fixup-h-vsync_end-instead-of-h-vtotal.patch queue-6.5/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-audio-detection.patch queue-6.5/drm-i915-mtl-avoid-stringop-overflow-warning.patch queue-6.5/drm-i915-tc-fix-wformat-truncation-in-intel_tc_port_.patch
Patch "drm/mediatek/dp: fix memory leak on ->get_edid callback error path" has been added to the 6.1-stable tree
This is a note to let you know that I've just added the patch titled drm/mediatek/dp: fix memory leak on ->get_edid callback error path to the 6.1-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch and it can be found in the queue-6.1 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc Mon Sep 17 00:00:00 2001 From: Jani Nikula Date: Thu, 14 Sep 2023 16:10:58 +0300 Subject: drm/mediatek/dp: fix memory leak on ->get_edid callback error path From: Jani Nikula commit fcaf9761fd5884a64eaac48536f8c27ecfd2e6bc upstream. Setting new_edid to NULL leaks the buffer. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Cc: Markus Schneider-Pargmann Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger 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: # v6.1+ Signed-off-by: Jani Nikula Reviewed-by: Guillaume Ranquet Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914131058.2472260-1-jani.nik...@intel.com/ Signed-off-by: Chun-Kuang Hu Signed-off-by: Greg Kroah-Hartman --- 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 @@ -2005,6 +2005,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; } Patches currently in stable-queue which might be from jani.nik...@intel.com are queue-6.1/drm-msm-dp-skip-validity-check-for-dp-cts-edid-check.patch queue-6.1/i915-perf-fix-null-deref-bugs-with-drm_dbg-calls.patch queue-6.1/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-error-path.patch queue-6.1/drm-mediatek-dp-fix-memory-leak-on-get_edid-callback-audio-detection.patch
Re: [PATCH] drm/mediatek/dp: fix memory leak on ->get_edid callback error path
Hi, Jani: Jani Nikula 於 2023年9月14日 週四 下午9:13寫道: > > Setting new_edid to NULL leaks the buffer. Applied to mediatek-drm-next [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-next Regards, Chun-Kuang. > > Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") > Cc: Markus Schneider-Pargmann > Cc: Guillaume Ranquet > Cc: Bo-Chen Chen > Cc: CK Hu > Cc: AngeloGioacchino Del Regno > Cc: Dmitry Osipenko > Cc: Chun-Kuang Hu > Cc: Philipp Zabel > Cc: Matthias Brugger > 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: # v6.1+ > Signed-off-by: Jani Nikula > > --- > > 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 >
Re: [PATCH] drm/mediatek/dp: fix memory leak on ->get_edid callback error path
On Thu, 14 Sep 2023 15:10, Jani Nikula wrote: >Setting new_edid to NULL leaks the buffer. > >Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") >Cc: Markus Schneider-Pargmann >Cc: Guillaume Ranquet >Cc: Bo-Chen Chen >Cc: CK Hu >Cc: AngeloGioacchino Del Regno >Cc: Dmitry Osipenko >Cc: Chun-Kuang Hu >Cc: Philipp Zabel >Cc: Matthias Brugger >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: # v6.1+ >Signed-off-by: Jani Nikula > Reviewed-by: Guillaume Ranquet >--- > >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 >
[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 Cc: Guillaume Ranquet Cc: Bo-Chen Chen Cc: CK Hu Cc: AngeloGioacchino Del Regno Cc: Dmitry Osipenko Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger 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: # v6.1+ Signed-off-by: Jani Nikula --- 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