media: meson: add missing allocation failure check on new_buf
Currently if the allocation of new_buf fails then a null pointer
dereference occurs when assiging new_buf->vb. Avoid this by returning
early on a memory allocation failure as there is not much more can
be done at this point.
Addresses-Coverity: ("Dereference null return")
Fixes: 3e7f51bd96
("media: meson: add v4l2 m2m video decoder driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Kevin Hilman <khilman@baylibre.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
55f240a21e
commit
11e0e167d0
@ -133,6 +133,8 @@ vdec_queue_recycle(struct amvdec_session *sess, struct vb2_buffer *vb)
|
||||
struct amvdec_buffer *new_buf;
|
||||
|
||||
new_buf = kmalloc(sizeof(*new_buf), GFP_KERNEL);
|
||||
if (!new_buf)
|
||||
return;
|
||||
new_buf->vb = vb;
|
||||
|
||||
mutex_lock(&sess->bufs_recycle_lock);
|
||||
|
Loading…
Reference in New Issue
Block a user