Skip to content

Commit 63e36a3

Browse files
QiushiWumchehab
authored andcommitted
media: platform: fcp: Fix a 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. Thus call pm_runtime_put_noidle() if pm_runtime_get_sync() fails. Fixes: 6eaafbd ("[media] v4l: rcar-fcp: Keep the coding style consistent") Signed-off-by: Qiushi Wu <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 884d638 commit 63e36a3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/media/platform/rcar-fcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ int rcar_fcp_enable(struct rcar_fcp_device *fcp)
102102
return 0;
103103

104104
ret = pm_runtime_get_sync(fcp->dev);
105-
if (ret < 0)
105+
if (ret < 0) {
106+
pm_runtime_put_noidle(fcp->dev);
106107
return ret;
108+
}
107109

108110
return 0;
109111
}

0 commit comments

Comments
 (0)