media: mtk-vcodec: venc: fix return value when start_streaming fails
authorDafna Hirschfeld <dafna.hirschfeld@collabora.com>
Fri, 28 May 2021 08:36:41 +0000 (10:36 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 18 Nov 2021 18:16:28 +0000 (19:16 +0100)
commite7f187649c245bff662911cf876cfaece507278f
tree3c6161f9ffe308d577db5cd838619c40cc742317
parent4f0ea72e4a34b281564019c3c4c89dea26b115b2
media: mtk-vcodec: venc: fix return value when start_streaming fails

[ Upstream commit 065a7c66bd8b21db212fa86187ff12f0cac6ea6d ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/mtk-vcodec/mtk_vcodec_enc.c