On Sat Jul 4 14:00:31 2026 +0530, Vidhu Sarwal wrote:
> ipu7_resume() calls pm_runtime_get_sync() before resuming the device.
> If the runtime PM resume fails, the usage count remains incremented, but
> the error path returns without dropping the reference.
> 
> Use pm_runtime_resume_and_get() instead, which balances the usage count
> on failure and avoids the leak. Keep returning 0 on error, as resume
> callbacks should not propagate failures to the PM core, matching the
> behaviour of the ipu6 driver.
> 
> Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
> Signed-off-by: Vidhu Sarwal <[email protected]>
> Signed-off-by: Sakari Ailus <[email protected]>

Patch committed.

Thanks,
Sakari Ailus

 drivers/staging/media/ipu7/ipu7.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

---

diff --git a/drivers/staging/media/ipu7/ipu7.c 
b/drivers/staging/media/ipu7/ipu7.c
index 056af3a07507..48a35bda4237 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2702,7 +2702,7 @@ static int ipu7_resume(struct device *dev)
        if (ret)
                dev_err(dev, "IPC reset protocol failed!\n");
 
-       ret = pm_runtime_get_sync(&isp->psys->auxdev.dev);
+       ret = pm_runtime_resume_and_get(&isp->psys->auxdev.dev);
        if (ret < 0) {
                dev_err(dev, "Failed to get runtime PM\n");
                return 0;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to