]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: coda: Add check for kmalloc
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 17 Nov 2022 07:02:36 +0000 (15:02 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 31 Dec 2022 12:26:11 +0000 (13:26 +0100)
commitaa17a252dbde432095e390e2092205d4debb12e1
tree36b9d85f4426f8fb3ffc9b14b3f1e814375199d2
parent532417dc98cb9c1185ada4ea4e7ccf965c06bcb5
media: coda: Add check for kmalloc

[ Upstream commit 6e5e5defdb8b0186312c2f855ace175aee6daf9b ]

As the kmalloc may return NULL pointer,
it should be better to check the return value
in order to avoid NULL poineter dereference,
same as the others.

Fixes: cb1d3a336371 ("[media] coda: add CODA7541 JPEG support")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/media/platform/chips-media/coda-bit.c