diff options
author | Irui Wang <irui.wang@mediatek.com> | 2023-09-26 13:19:08 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-10-05 12:34:29 +0300 |
commit | 1146bec0ca34375f963f79f5c4e6b49ed5386aaa (patch) | |
tree | 82243827975bac71b301801527b67b0b701c7d9a /drivers/media | |
parent | 6bd01c4299d4428738ab18f59334ce8b8207a531 (diff) | |
download | linux-1146bec0ca34375f963f79f5c4e6b49ed5386aaa.tar.xz |
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: 1972e32431ed ("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>
Diffstat (limited to 'drivers/media')
-rw-r--r-- | drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |