media: mediatek: vcodec: Handle invalid encoder vsi
Subsystems (3)
PATCH v2 1/1 media: mediatek: vcodec: Handle invalid encoder vsi
Handle invalid encoder vsi in vpu_enc_init to ensure the encoder vsi is valid for future use.
Fixes 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")
Signed-off-by Irui Wang <[email protected]>
---
changed with v1:
- add Fixes tag
- move vsi check to vpu_enc_init
- update commit message
--- drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/media/platform/mediatek/vcodec/encoder/venc_vpu_if.c +5 -0
@@ -153,6 +153,11 @@ int vpu_enc_init(struct venc_vpu_inst *vpu)return -EINVAL ; } +if (IS_ERR_OR_NULL (vpu->vsi)) { +mtk_venc_err (vpu->ctx,"invalid venc vsi" ); +return -EINVAL ; + } +return 0 ; }
Signature · 1 line
2.18.0
Il 07/10/23 13:33, Irui Wang ha scritto:
Quoted 6 lines
Handle invalid encoder vsi in
vpu_enc_initto ensure the encoder vsi is valid for future use.Fixes 1972e32431ed ("media: mediatek: vcodec: Fix possible invalid memory access for encoder")Signed-off-by Irui Wang <[email protected]>
Reviewed-by AngeloGioacchino Del Regno <[email protected]>