media: coda: Add check for kmalloc
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Thu, 17 Nov 2022 07:02:36 +0000 (15:02 +0800)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 7 Dec 2022 16:58:47 +0000 (17:58 +0100)
commit6e5e5defdb8b0186312c2f855ace175aee6daf9b
tree507f1aab0991d694b3af34431d08a07b7ccfffc8
parent6b8082238fb8bb20f67e46388123e67a5bbc558d
media: coda: Add check for kmalloc

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>
drivers/media/platform/chips-media/coda-bit.c