]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: meson: add missing allocation failure check on new_buf
authorColin Ian King <colin.king@canonical.com>
Wed, 4 Dec 2019 14:11:59 +0000 (15:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Feb 2020 07:36:23 +0000 (08:36 +0100)
commit343fc9a268874621c5d0fbd9e4a0e5c74c5ee0c3
treeee9303d88ed70713fbfc1ad091cf9ce8e9c21f25
parent85275286d118c863167d5ad86342221e3433ca4f
media: meson: add missing allocation failure check on new_buf

[ Upstream commit 11e0e167d071a28288a7a0a211d48c571d19b56f ]

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: 3e7f51bd9607 ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/meson/vdec/vdec.c