summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWentao Liang <vulab@iscas.ac.cn>2026-09-16 17:42:29 +0000
committerChun-Kuang Hu <chunkuang.hu@kernel.org>2026-10-01 22:52:44 +0000
commit2af45da333bdd7be2666688a0f861e0750e40e49 (patch)
treeb4516198d9d529a9c02d67bcf8be3ae5aef90a8b
parent3753e34b73fcbe2a2edbe984614a008a261697ef (diff)
downloadlinux-stable-2af45da333bdd7be2666688a0f861e0750e40e49.tar.gz
linux-stable-2af45da333bdd7be2666688a0f861e0750e40e49.zip
drm/mediatek: Fix runtime PM leak in mtk_hdmi_ddc_v2_probe()
pm_runtime_get_sync() unconditionally bumps the usage counter, but nothing puts it back when devm_i2c_add_adapter() fails, leaving the DDC runtime-resumed after a failed probe. Drop the reference on that error path. Fixes: 8d0f79886273 ("drm/mediatek: Introduce HDMI/DDC v2 for MT8195/MT8188") Signed-off-by: Wentao Liang <vulab@iscas.ac.cn> Link: https://patchwork.kernel.org/project/linux-mediatek/patch/20260916174229.2088824-1-vulab@iscas.ac.cn/ Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
-rw-r--r--drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c b/drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c
index 31e81a6de..1ec973d3f 100644
--- a/drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c
+++ b/drivers/gpu/drm/mediatek/mtk_hdmi_ddc_v2.c
@@ -376,8 +376,10 @@ static int mtk_hdmi_ddc_v2_probe(struct platform_device *pdev)
pm_runtime_get_sync(dev);
ret = devm_i2c_add_adapter(dev, &ddc->adap);
- if (ret < 0)
+ if (ret < 0) {
+ pm_runtime_put_noidle(dev);
return dev_err_probe(dev, ret, "Cannot add DDC I2C adapter\n");
+ }
platform_set_drvdata(pdev, ddc);
return 0;