qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info
authorDaniil Tatianin <d-tatianin@yandex-team.ru>
Thu, 16 Mar 2023 10:29:21 +0000 (13:29 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Mar 2023 10:47:45 +0000 (12:47 +0200)
commite42d3bde4ec03c863259878dddaef5c351cca7ad
tree060e8ce7c6fa3b60304950d103cde3fdaed02cc5
parentba6c40227108f8ee428e42eb0337b48ed3001e65
qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info

[ Upstream commit 25143b6a01d0cc5319edd3de22ffa2578b045550 ]

We have to make sure that the info returned by the helper is valid
before using it.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.

Fixes: f990c82c385b ("qed*: Add support for ndo_set_vf_trust")
Fixes: 733def6a04bf ("qed*: IOV link control")
Signed-off-by: Daniil Tatianin <d-tatianin@yandex-team.ru>
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/qlogic/qed/qed_sriov.c