media: mediatek: vcodec: Handle invalid decoder vsi
BugLink: https://bugs.launchpad.net/bugs/2083196
[ Upstream commit 59d438f8e02ca641c58d77e1feffa000ff809e9f ]
Handle an invalid decoder vsi in vpu_dec_init to ensure the decoder vsi
is valid for future use.
Fixes: 590577a4e5 ("[media] vcodec: mediatek: Add Mediatek V4L2 Video Decoder Driver")
Signed-off-by: Irui Wang <irui.wang@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
This commit is contained in:
committed by
Mehmet Basaran
parent
e1c1d4a5b4
commit
810d5e866b
@@ -233,6 +233,12 @@ int vpu_dec_init(struct vdec_vpu_inst *vpu)
|
||||
mtk_vdec_debug(vpu->ctx, "vdec_inst=%p", vpu);
|
||||
|
||||
err = vcodec_vpu_send_msg(vpu, (void *)&msg, sizeof(msg));
|
||||
|
||||
if (IS_ERR_OR_NULL(vpu->vsi)) {
|
||||
mtk_vdec_err(vpu->ctx, "invalid vdec vsi, status=%d", err);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
mtk_vdec_debug(vpu->ctx, "- ret=%d", err);
|
||||
return err;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user