mirror of
https://github.com/torvalds/linux.git
synced 2024-11-18 18:11:56 +00:00
media: cedrus: fix reference leak in cedrus_start_streaming
pm_runtime_get_sync will increment pm usage counter even it
failed. Forgetting to pm_runtime_put_noidle will result in
reference leak in cedrus_start_streaming. We should fix it.
Fixes: d5aecd289b
("media: cedrus: Implement runtime PM")
Signed-off-by: Zhang Qilong <zhangqilong3@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
4cbbe2aaa0
commit
940727bf22
@ -479,8 +479,10 @@ static int cedrus_start_streaming(struct vb2_queue *vq, unsigned int count)
|
||||
|
||||
if (V4L2_TYPE_IS_OUTPUT(vq->type)) {
|
||||
ret = pm_runtime_get_sync(dev->dev);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
pm_runtime_put_noidle(dev->dev);
|
||||
goto err_cleanup;
|
||||
}
|
||||
|
||||
if (dev->dec_ops[ctx->current_codec]->start) {
|
||||
ret = dev->dec_ops[ctx->current_codec]->start(ctx);
|
||||
|
Loading…
Reference in New Issue
Block a user