]> git.itanic.dy.fi Git - linux-stable/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)
committerDavid S. Miller <davem@davemloft.net>
Sun, 19 Mar 2023 08:40:48 +0000 (08:40 +0000)
commit25143b6a01d0cc5319edd3de22ffa2578b045550
tree27c51f5366af8f87823eeab0336e392ca10ba69c
parente866f29a6ff1804efb5c9cfc1e354192615dfb64
qed/qed_sriov: guard against NULL derefs from qed_iov_get_vf_info

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>
drivers/net/ethernet/qlogic/qed/qed_sriov.c