sfc: Check null pointer of rx_queue->page_ring
authorJiasheng Jiang <jiasheng@iscas.ac.cn>
Mon, 20 Dec 2021 13:56:03 +0000 (21:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:28:44 +0000 (12:28 +0100)
commit20c3efcca6126f1c2bac32dc73daa3c5d8c9e3d2
tree26f5170f5312ffecf064536d01243b05cf964484
parent8307c1ecd36691718cc4044c8f8e87c8e0cc82f8
sfc: Check null pointer of rx_queue->page_ring

[ Upstream commit bdf1b5c3884f6a0dc91b0dbdb8c3b7d205f449e0 ]

Because of the possible failure of the kcalloc, it should be better to
set rx_queue->page_ptr_mask to 0 when it happens in order to maintain
the consistency.

Fixes: 5a6681e22c14 ("sfc: separate out SFC4000 ("Falcon") support into new sfc-falcon driver")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
Link: https://lore.kernel.org/r/20211220135603.954944-1-jiasheng@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/sfc/rx_common.c