Skip to content

Commit 7dae2aa

Browse files
QiushiWumchehab
authored andcommitted
media: ti-vpe: Fix a missing check and reference count leak
pm_runtime_get_sync() increments the runtime PM usage counter even when it returns an error code, causing incorrect ref count if pm_runtime_put_noidle() is not called in error handling paths. And also, when the call of function vpe_runtime_get() failed, we won't call vpe_runtime_put(). Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails inside vpe_runtime_get(). Fixes: 4571912 ("[media] v4l: ti-vpe: Add VPE mem to mem driver") Signed-off-by: Qiushi Wu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 88f50a0 commit 7dae2aa

File tree

1 file changed

+2
-0
lines changed
  • drivers/media/platform/ti-vpe

1 file changed

+2
-0
lines changed

drivers/media/platform/ti-vpe/vpe.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2475,6 +2475,8 @@ static int vpe_runtime_get(struct platform_device *pdev)
24752475

24762476
r = pm_runtime_get_sync(&pdev->dev);
24772477
WARN_ON(r < 0);
2478+
if (r)
2479+
pm_runtime_put_noidle(&pdev->dev);
24782480
return r < 0 ? r : 0;
24792481
}
24802482

0 commit comments

Comments
 (0)