On Sat Jul 4 14:00:30 2026 +0530, Vidhu Sarwal wrote:
> ipu7_init_fw_code_region_by_sys() calls pm_runtime_get_sync() before
> accessing the firmware code region. If resuming the device fails,
> pm_runtime_get_sync() leaves the runtime PM usage count incremented,
> but the error path returns without dropping the reference.
> 
> Use pm_runtime_resume_and_get() instead, which balances the usage count
> automatically on failure and avoids the leak.
> 
> The ipu6 driver uses pm_runtime_resume_and_get() in the equivalent
> location.
> 
> 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 310e3f24e571..056af3a07507 100644
--- a/drivers/staging/media/ipu7/ipu7.c
+++ b/drivers/staging/media/ipu7/ipu7.c
@@ -2343,7 +2343,7 @@ static int ipu7_init_fw_code_region_by_sys(struct 
ipu7_bus_device *sys,
                return ret;
        }
 
-       ret = pm_runtime_get_sync(dev);
+       ret = pm_runtime_resume_and_get(dev);
        if (ret < 0) {
                dev_err(dev, "Failed to get runtime PM\n");
                return ret;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to