]> git.baikalelectronics.ru Git - kernel.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>
Wed, 18 Jan 2023 10:41:12 +0000 (11:41 +0100)
commitb25efa2797a12e1fea5a03173d65c985f85288a8
tree122dbbe0a0e67bb2e7fad256f5b7f24249177f3c
parent036e8a3a6d0ca8c99e065fcae6434402a7878582
media: coda: Add check for kmalloc

[ Upstream commit e1a86f7047660888ed14b8c6d87d7e5f8cf16a48 ]

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: 064607fd6583 ("[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