diff options
author | Zhang Qilong <zhangqilong3@huawei.com> | 2020-11-02 15:26:22 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2020-11-16 10:31:16 +0100 |
commit | 940727bf22f74cbdef8de327de34c4ae565c89ea (patch) | |
tree | 7eb9b92696e36d3c2dc762802c926b87752f1604 /drivers/staging/media/sunxi | |
parent | 4cbbe2aaa0536b0e7b3dfbd7febc3bc2ec300559 (diff) | |
download | linux-940727bf22f74cbdef8de327de34c4ae565c89ea.tar.bz2 |
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: d5aecd289babf ("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>
Diffstat (limited to 'drivers/staging/media/sunxi')
-rw-r--r-- | drivers/staging/media/sunxi/cedrus/cedrus_video.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c index 667b86dde1ee..911f607d9b09 100644 --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c @@ -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); |