devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] media: mediatek: vcodec: Fix encoder access NULL pointer
@ 2023-09-26 10:19 Irui Wang
  2023-09-26 10:19 ` [PATCH 2/2] media: mediatek: vcodec: Handle encoder vsi NULL pointer case Irui Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Irui Wang @ 2023-09-26 10:19 UTC (permalink / raw)
  To: Hans Verkuil, Mauro Carvalho Chehab, Matthias Brugger,
	angelogioacchino.delregno, nicolas.dufresne, Yunfei Dong,
	Irui Wang
  Cc: Project_Global_Chrome_Upstream_Group, linux-media, devicetree,
	linux-kernel, linux-arm-kernel, linux-mediatek, Maoguang Meng

Need to set the private data with encoder device, or will access
NULL pointer in encoder handler.

Fixes: 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")

Signed-off-by: Irui Wang <irui.wang@mediatek.com>
---
 drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c
index d299cc2962a5..ae6290d28f8e 100644
--- a/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c
+++ b/drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c
@@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu)
 	vpu->ctx->vpu_inst = vpu;
 
 	status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id,
-					    vpu_enc_ipi_handler, "venc", NULL);
+					    vpu_enc_ipi_handler, "venc",
+					    vpu->ctx->dev);
 
 	if (status) {
 		mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status);
-- 
2.25.1


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

end of thread, other threads:[~2023-10-07  6:16 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-26 10:19 [PATCH 1/2] media: mediatek: vcodec: Fix encoder access NULL pointer Irui Wang
2023-09-26 10:19 ` [PATCH 2/2] media: mediatek: vcodec: Handle encoder vsi NULL pointer case Irui Wang
2023-10-02 10:25   ` Hans Verkuil
2023-10-02 10:48   ` AngeloGioacchino Del Regno
2023-10-02 11:34     ` AngeloGioacchino Del Regno
2023-10-05  8:43   ` Hans Verkuil
2023-10-07  6:16     ` Irui Wang (王瑞)
2023-10-02 10:24 ` [PATCH 1/2] media: mediatek: vcodec: Fix encoder access NULL pointer Hans Verkuil
2023-10-04  6:54   ` Hans Verkuil
2023-10-05  8:46     ` Hans Verkuil
2023-10-07  1:49       ` Irui Wang (王瑞)
2023-10-02 10:48 ` AngeloGioacchino Del Regno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).