* [PATCH 6.5 427/491] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection
[not found] <20231124172024.664207345@linuxfoundation.org>
@ 2023-11-24 17:51 ` Greg Kroah-Hartman
2023-11-24 17:51 ` [PATCH 6.5 428/491] drm/mediatek/dp: fix memory leak on ->get_edid callback error path Greg Kroah-Hartman
1 sibling, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-24 17:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Guillaume Ranquet, Bo-Chen Chen,
AngeloGioacchino Del Regno, Dmitry Osipenko, Chun-Kuang Hu,
Philipp Zabel, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel, Jani Nikula, Chen-Yu Tsai
6.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <jani.nikula@intel.com>
commit dab12fa8d2bd3868cf2de485ed15a3feef28a13d upstream.
The sads returned by drm_edid_to_sad() needs to be freed.
Fixes: e71a8ebbe086 ("drm/mediatek: dp: Audio support for MT8195")
Cc: Guillaume Ranquet <granquet@baylibre.com>
Cc: Bo-Chen Chen <rex-bc.chen@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: Chen-Yu Tsai <wenst@chromium.org>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20230914155317.2511876-1-jani.nikula@intel.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/gpu/drm/mediatek/mtk_dp.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
--- a/drivers/gpu/drm/mediatek/mtk_dp.c
+++ b/drivers/gpu/drm/mediatek/mtk_dp.c
@@ -1983,7 +1983,6 @@ static struct edid *mtk_dp_get_edid(stru
bool enabled = mtk_dp->enabled;
struct edid *new_edid = NULL;
struct mtk_dp_audio_cfg *audio_caps = &mtk_dp->info.audio_cur_cfg;
- struct cea_sad *sads;
if (!enabled) {
drm_atomic_bridge_chain_pre_enable(bridge, connector->state->state);
@@ -2010,7 +2009,11 @@ static struct edid *mtk_dp_get_edid(stru
}
if (new_edid) {
+ struct cea_sad *sads;
+
audio_caps->sad_count = drm_edid_to_sad(new_edid, &sads);
+ kfree(sads);
+
audio_caps->detect_monitor = drm_detect_monitor_audio(new_edid);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 6.5 428/491] drm/mediatek/dp: fix memory leak on ->get_edid callback error path
[not found] <20231124172024.664207345@linuxfoundation.org>
2023-11-24 17:51 ` [PATCH 6.5 427/491] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection Greg Kroah-Hartman
@ 2023-11-24 17:51 ` Greg Kroah-Hartman
1 sibling, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2023-11-24 17:51 UTC (permalink / raw)
To: stable
Cc: Greg Kroah-Hartman, patches, Markus Schneider-Pargmann,
Guillaume Ranquet, Bo-Chen Chen, CK Hu,
AngeloGioacchino Del Regno, Dmitry Osipenko, Chun-Kuang Hu,
Philipp Zabel, Matthias Brugger, dri-devel, linux-mediatek,
linux-kernel, linux-arm-kernel, Jani Nikula
6.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jani Nikula <jani.nikula@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 <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>
Signed-off-by: Greg Kroah-Hartman <gregkh@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
@@ -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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-11-24 18:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231124172024.664207345@linuxfoundation.org>
2023-11-24 17:51 ` [PATCH 6.5 427/491] drm/mediatek/dp: fix memory leak on ->get_edid callback audio detection Greg Kroah-Hartman
2023-11-24 17:51 ` [PATCH 6.5 428/491] drm/mediatek/dp: fix memory leak on ->get_edid callback error path Greg Kroah-Hartman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).