Skip to content

Commit

Permalink
media: mediatek: vcodec: Return NULL if no vdec_fb is found
Browse files Browse the repository at this point in the history
[ Upstream commit dfa2d6e ]

"fb_use_list" is used to store used or referenced frame buffers for
vp9 stateful decoder. "NULL" should be returned when getting target
frame buffer failed from "fb_use_list", not a random unexpected one.

Fixes: f77e898 ("[media] vcodec: mediatek: Add Mediatek VP9 Video Decoder Driver")
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>
  • Loading branch information
irui-wang authored and gregkh committed Sep 13, 2023
1 parent b4ee61e commit a356b60
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/platform/mediatek/vcodec/vdec/vdec_vp9_if.c
Expand Up @@ -226,10 +226,11 @@ static struct vdec_fb *vp9_rm_from_fb_use_list(struct vdec_vp9_inst
if (fb->base_y.va == addr) {
list_move_tail(&node->list,
&inst->available_fb_node_list);
break;
return fb;
}
}
return fb;

return NULL;
}

static void vp9_add_to_fb_free_list(struct vdec_vp9_inst *inst,
Expand Down

0 comments on commit a356b60

Please sign in to comment.