OSDN Git Service

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>
Thu, 19 May 2022 15:45:56 +0000 (17:45 +0200)
commitf94b47c6bde624d6c07f43054087607c52054a95
treeb794a10f5097b4d0201344f3ddbdb23136ced9a5
parent455d5f02dc23f4e7a298b1f4acb5dc5457e08801
staging: r8188eu: add check for kzalloc

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>
drivers/staging/r8188eu/core/rtw_xmit.c
drivers/staging/r8188eu/include/rtw_xmit.h