diff options
author | Dafna Hirschfeld <dafna.hirschfeld@collabora.com> | 2021-05-28 10:36:41 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+huawei@kernel.org> | 2021-09-30 10:07:53 +0200 |
commit | 065a7c66bd8b21db212fa86187ff12f0cac6ea6d (patch) | |
tree | c3ff283b90fb4d69c2e73147a308e8fdc09b211b | |
parent | a6b63ca455a19f263d56599f4b37cb1d61eb8fee (diff) | |
download | linux-stable-065a7c66bd8b21db212fa86187ff12f0cac6ea6d.tar.gz linux-stable-065a7c66bd8b21db212fa86187ff12f0cac6ea6d.tar.bz2 linux-stable-065a7c66bd8b21db212fa86187ff12f0cac6ea6d.zip |
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: 985c73693fe5a (" media: mtk-vcodec: Separating mtk encoder driver")
Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r-- | drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c index efa53ea573a2..7457451ebff0 100644 --- a/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c +++ b/drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c @@ -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 venc_enc_param param; - int ret; + int ret, pm_ret; int i; /* 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) return 0; err_set_param: - ret = pm_runtime_put(&ctx->dev->plat_dev->dev); - if (ret < 0) - mtk_v4l2_err("pm_runtime_put fail %d", ret); + pm_ret = pm_runtime_put(&ctx->dev->plat_dev->dev); + if (pm_ret < 0) + mtk_v4l2_err("pm_runtime_put fail %d", pm_ret); err_start_stream: for (i = 0; i < q->num_buffers; ++i) { |