public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 6.1] media: mediatek: vcodec: Handle invalid decoder vsi
@ 2024-12-06  1:27 bin.lan.cn
  2024-12-06 17:11 ` Sasha Levin
  0 siblings, 1 reply; 2+ messages in thread
From: bin.lan.cn @ 2024-12-06  1:27 UTC (permalink / raw)
  To: stable, irui.wang

From: Irui Wang <irui.wang@mediatek.com>

[ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]

Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi
is valid for future use.

Fixes: 590577a4e525 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[ Resolve minor conflicts ]
Signed-off-by: Bin Lan <bin.lan.cn@windriver.com>
---
 drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
index df309e8e9379..23984cfe2b7e 100644
--- a/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
+++ b/drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c
@@ -213,6 +213,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
 	mtk_vcodec_debug(vpu, "vdec_inst=%p", vpu);
 
 	err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
+
+	if (IS_ERR_OR_NULL(vpu->vsi)) {
+		mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d", err);
+		return -EINVAL;
+	}
+
 	mtk_vcodec_debug(vpu, "- ret=%d", err);
 	return err;
 }
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 6.1] media: mediatek: vcodec: Handle invalid decoder vsi
  2024-12-06  1:27 [PATCH 6.1] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
@ 2024-12-06 17:11 ` Sasha Levin
  0 siblings, 0 replies; 2+ messages in thread
From: Sasha Levin @ 2024-12-06 17:11 UTC (permalink / raw)
  To: stable; +Cc: bin.lan.cn, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

The upstream commit SHA1 provided is correct: 59d438f8e02ca641c58d77e1feffa000ff809e9f

WARNING: Author mismatch between patch and upstream commit:
Backport author: bin.lan.cn@eng.windriver.com
Commit author: Irui Wang <irui.wang@mediatek.com>


Status in newer kernel trees:
6.12.y | Present (exact SHA1)
6.6.y | Present (different SHA1: 1c109f23b271)
6.1.y | Not found

Note: The patch differs from the upstream commit:
---
1:  59d438f8e02ca < -:  ------------- media: mediatek: vcodec: Handle invalid decoder vsi
-:  ------------- > 1:  b76bf4673f978 media: mediatek: vcodec: Handle invalid decoder vsi
---

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.1.y        |  Success    |  Failed    |

Build Errors:
Build error for stable/linux-6.1.y:
    drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c: In function 'vpu_dec_init':
    drivers/media/platform/mediatek/vcodec/vdec_vpu_if.c:218:17: error: implicit declaration of function 'mtk_vdec_err'; did you mean 'mtk_vcodec_err'? [-Wimplicit-function-declaration]
      218 |                 mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d", err);
          |                 ^~~~~~~~~~~~
          |                 mtk_vcodec_err
    make[6]: *** [scripts/Makefile.build:250: drivers/media/platform/mediatek/vcodec/vdec_vpu_if.o] Error 1
    make[6]: Target 'drivers/media/platform/mediatek/vcodec/' not remade because of errors.
    make[5]: *** [scripts/Makefile.build:503: drivers/media/platform/mediatek/vcodec] Error 2
    make[5]: Target 'drivers/media/platform/mediatek/' not remade because of errors.
    make[4]: *** [scripts/Makefile.build:503: drivers/media/platform/mediatek] Error 2
    make[4]: Target 'drivers/media/platform/' not remade because of errors.
    make[3]: *** [scripts/Makefile.build:503: drivers/media/platform] Error 2
    make[3]: Target 'drivers/media/' not remade because of errors.
    make[2]: *** [scripts/Makefile.build:503: drivers/media] Error 2
    make[2]: Target 'drivers/' not remade because of errors.
    make[1]: *** [scripts/Makefile.build:503: drivers] Error 2
    make[1]: Target './' not remade because of errors.
    make: *** [Makefile:2009: .] Error 2
    make: Target '__all' not remade because of errors.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2024-12-06 17:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-06  1:27 [PATCH 6.1] media: mediatek: vcodec: Handle invalid decoder vsi bin.lan.cn
2024-12-06 17:11 ` Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox