net: chelsio: cxgb3: check the return value of pci_find_capability()
authorJia-Ju Bai <baijiaju1990@gmail.com>
Fri, 25 Feb 2022 12:37:27 +0000 (04:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Mar 2022 18:00:58 +0000 (19:00 +0100)
commitf41e3f409f7dab1651161afc93121cf110c280f2
tree1f922ab958844e099aeedcefddfe735c3d0a3a54
parent94920a4e596da07e5f58160bfc5084befcb0928a
net: chelsio: cxgb3: check the return value of pci_find_capability()

[ Upstream commit 767b9825ed1765894e569a3d698749d40d83762a ]

The function pci_find_capability() in t3_prep_adapter() can fail, so its
return value should be checked.

Fixes: 4d22de3e6cc4 ("Add support for the latest 1G/10G Chelsio adapter, T3")
Reported-by: TOTE Robot <oslab@tsinghua.edu.cn>
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/chelsio/cxgb3/t3_hw.c