]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 5 Apr 2023 09:16:37 +0000 (11:16 +0200)
commit6e34e98077d31abe7556427fb159221af835383e
treef38346b0677d0f023f7364652ebf164757c46d8c
parent3ef2ffe5b9d8bb958756580a326717441280d16f
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: 54c9a30ebc7d ("qed*: Add support for ndo_set_vf_trust")
Fixes: b13581ed14c6 ("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