media: s3c-camif: fix PM reference leak in s3c_camif_open()
Subsystems (3)
PATCH 1/1 media: s3c-camif: fix PM reference leak in s3c_camif_open()
pm_runtime_get_sync will increment pm usage counter even it failed. Forgetting to putting operation will result in reference leak here. Fix it by replacing it with pm_runtime_resume_and_get to keep usage counter balanced.
Reported-by Hulk Robot <[email protected]>
Signed-off-by Lu Jialin <[email protected]>
--- drivers/media/platform/s3c-camif/camif-capture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/s3c-camif/camif-capture.c +1 -1
@@ -547,7 +547,7 @@ static int s3c_camif_open(struct file *file)if (ret <0 ) goto unlock; - ret =pm_runtime_get_sync (camif->dev); + ret =pm_runtime_resume_and_get (camif->dev);if (ret <0 ) goto err_pm;