Commit 065a7c66 authored by Dafna Hirschfeld's avatar Dafna Hirschfeld Committed by Mauro Carvalho Chehab

media: mtk-vcodec: venc: fix return value when start_streaming fails

In case vb2ops_venc_start_streaming fails, the error value
is overwritten by the ret value of pm_runtime_put which might
be 0. Fix it.

Fixes: 985c7369 (" media: mtk-vcodec: Separating mtk encoder driver")
Signed-off-by: default avatarDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent a6b63ca4
...@@ -873,7 +873,7 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -873,7 +873,7 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count)
{ {
struct mtk_vcodec_ctx *ctx = vb2_get_drv_priv(q); struct mtk_vcodec_ctx *ctx = vb2_get_drv_priv(q);
struct venc_enc_param param; struct venc_enc_param param;
int ret; int ret, pm_ret;
int i; int i;
/* Once state turn into MTK_STATE_ABORT, we need stop_streaming /* Once state turn into MTK_STATE_ABORT, we need stop_streaming
...@@ -925,9 +925,9 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count) ...@@ -925,9 +925,9 @@ static int vb2ops_venc_start_streaming(struct vb2_queue *q, unsigned int count)
return 0; return 0;
err_set_param: err_set_param:
ret = pm_runtime_put(&ctx->dev->plat_dev->dev); pm_ret = pm_runtime_put(&ctx->dev->plat_dev->dev);
if (ret < 0) if (pm_ret < 0)
mtk_v4l2_err("pm_runtime_put fail %d", ret); mtk_v4l2_err("pm_runtime_put fail %d", pm_ret);
err_start_stream: err_start_stream:
for (i = 0; i < q->num_buffers; ++i) { for (i = 0; i < q->num_buffers; ++i) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment