media: renesas: rzv2h-ivc: manage runtime PM with devres

Runtime PM is enabled before the IRQ is looked up.  If that lookup
fails, probe returns without disabling runtime PM.  The subdevice
initialization error path disables runtime PM but leaves autosuspend
enabled, while the remove path does neither.

Use devm_pm_runtime_enable() so the driver core disables autosuspend and
runtime PM on every failed probe and after remove.  This also makes the
manual subdevice error unwind unnecessary.

This issue was identified during our ongoing static-analysis research while
reviewing kernel code.

Fixes: f0b3984d82 ("media: platform: Add Renesas Input Video Control block driver")
Cc: stable@vger.kernel.org
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Myeonghun Pak 2026-08-04 23:11:04 +09:00 committed by Hans Verkuil
parent 2d3873cadd
commit 64e07ebcb3

View File

@ -202,7 +202,9 @@ static int rzv2h_ivc_probe(struct platform_device *pdev)
pm_runtime_set_autosuspend_delay(dev, 2000);
pm_runtime_use_autosuspend(dev);
pm_runtime_enable(dev);
ret = devm_pm_runtime_enable(dev);
if (ret)
return ret;
ivc->irqnum = platform_get_irq(pdev, 0);
if (ivc->irqnum < 0)
@ -210,14 +212,9 @@ static int rzv2h_ivc_probe(struct platform_device *pdev)
ret = rzv2h_ivc_initialise_subdevice(ivc);
if (ret)
goto err_disable_pm_runtime;
return ret;
return 0;
err_disable_pm_runtime:
pm_runtime_disable(dev);
return ret;
}
static void rzv2h_ivc_remove(struct platform_device *pdev)