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:14:18 +0000 (13:14 +0100)
commit441c05485cf1a29eef05c1fd8281716815283315
tree804a8f77386c0bae470ceb7ffdfe1a618108adad
parentb99872178e7473f21904fdeea38109275aad8ae8
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/coda/coda-bit.c