Skip to content

Commit 1146bec

Browse files
irui-wangHans Verkuil
authored andcommitted
media: mediatek: vcodec: Fix encoder access NULL pointer
Need to set the private data with encoder device, or will access NULL pointer in encoder handler. Fixes: 1972e32 ("media: mediatek: vcodec: Fix possible invalid memory access for encoder") Signed-off-by: Irui Wang <irui.wang@mediatek.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent 6bd01c4 commit 1146bec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ int vpu_enc_init(struct venc_vpu_inst *vpu)
138138
vpu->ctx->vpu_inst = vpu;
139139

140140
status = mtk_vcodec_fw_ipi_register(vpu->ctx->dev->fw_handler, vpu->id,
141-
vpu_enc_ipi_handler, "venc", NULL);
141+
vpu_enc_ipi_handler, "venc",
142+
vpu->ctx->dev);
142143

143144
if (status) {
144145
mtk_venc_err(vpu->ctx, "vpu_ipi_register fail %d", status);

0 commit comments

Comments
 (0)