sfc_ef100: potential dereference of null pointer
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Wed, 15 Dec 2021 14:37:31 +0000 (22:37 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Dec 2021 08:30:55 +0000 (09:30 +0100)
commit734a3f3106053ee41cecae2a995b3d4d0c246764
tree72c0fe5bbdba9144a40200316f02cd48eb14a44a
parent7da349f07e457cad135df0920a3f670e423fb5e9
sfc_ef100: potential dereference of null pointer

[ Upstream commit 407ecd1bd726f240123f704620d46e285ff30dd9 ]

The return value of kmalloc() needs to be checked.
To avoid use in efx_nic_update_stats() in case of the failure of alloc.

Fixes: b593b6f1b492 ("sfc_ef100: statistics gathering")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sfc/ef100_nic.c