media: mediatek: vcodec: Handle invalid encoder vsi
[ Upstream commit19e2e01f30
] Handle invalid encoder vsi in vpu_enc_init to ensure the encoder vsi is valid for future use. Fixes:1972e32431
("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
0747b6f7a3
commit
a4b31459ce
@ -154,6 +154,11 @@ int vpu_enc_init(struct venc_vpu_inst *vpu)
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (IS_ERR_OR_NULL(vpu->vsi)) {
|
||||||
|
mtk_venc_err(vpu->ctx, "invalid venc vsi");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user