Skip to content

Commit

Permalink
media: rockchip/rga: Fix a reference count leak.
Browse files Browse the repository at this point in the history
[ Upstream commit 884d638 ]

pm_runtime_get_sync() increments the runtime PM usage counter even
when it returns an error code. Thus call pm_runtime_put_noidle()
if pm_runtime_get_sync() fails.

Fixes: f7e7b48 ("[media] rockchip/rga: v4l2 m2m support")
Signed-off-by: Qiushi Wu <wu000273@umn.edu>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
QiushiWu authored and gregkh committed Oct 29, 2020
1 parent 5e32b7f commit 893662c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/media/platform/rockchip/rga/rga-buf.c
Expand Up @@ -81,6 +81,7 @@ static int rga_buf_start_streaming(struct vb2_queue *q, unsigned int count)

ret = pm_runtime_get_sync(rga->dev);
if (ret < 0) {
pm_runtime_put_noidle(rga->dev);
rga_buf_return_buffers(q, VB2_BUF_STATE_QUEUED);
return ret;
}
Expand Down

0 comments on commit 893662c

Please sign in to comment.