From: Irui Wang <irui.wang@mediatek.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
<angelogioacchino.delregno@collabora.com>,
<nicolas.dufresne@collabora.com>,
Yunfei Dong <yunfei.dong@mediatek.com>,
Irui Wang <irui.wang@mediatek.com>
Cc: <Project_Global_Chrome_Upstream_Group@mediatek.com>,
<linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-mediatek@lists.infradead.org>,
Maoguang Meng <maoguang.meng@mediatek.com>
Subject: [PATCH 1/2] media: mediatek: vcodec: Fix encoder access NULL pointer
Date: Tue, 26 Sep 2023 18:19:08 +0800 [thread overview]
Message-ID: <20230926101909.15030-1-irui.wang@mediatek.com> (raw)
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
next reply other threads:[~2023-09-26 10:19 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-09-26 10:19 Irui Wang [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230926101909.15030-1-irui.wang@mediatek.com \
--to=irui.wang@mediatek.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=angelogioacchino.delregno@collabora.com \
--cc=devicetree@vger.kernel.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=maoguang.meng@mediatek.com \
--cc=matthias.bgg@gmail.com \
--cc=mchehab@kernel.org \
--cc=nicolas.dufresne@collabora.com \
--cc=yunfei.dong@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome