staging: r8188eu: add check for kzalloc
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 18 May 2022 07:59:57 +0000 (15:59 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 16:36:07 +0000 (18:36 +0200)
commit029983ea88e59f4c7dc0d56ade2b16d6b869bf94
tree52b70b6f241bbb6b8d4f2100cd366cde5c879bc1
parente1928887219b09140c043eed13fbd30bf22bd68e
staging: r8188eu: add check for kzalloc

[ Upstream commit f94b47c6bde624d6c07f43054087607c52054a95 ]

As kzalloc() may return null pointer, it should be better to
check the return value and return error if fails in order
to avoid dereference of null pointer.
Moreover, the return value of rtw_alloc_hwxmits() should also
be dealt with.

Fixes: 15865124feed ("staging: r8188eu: introduce new core dir for RTL8188eu driver")
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Link: https://lore.kernel.org/r/20220518075957.514603-1-jiasheng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/r8188eu/core/rtw_xmit.c
drivers/staging/r8188eu/include/rtw_xmit.h