i40e: fix vf may be used uninitialized in this function warning
authorAleksandr Loktionov <aleksandr.loktionov@intel.com>
Wed, 13 Mar 2024 09:56:39 +0000 (10:56 +0100)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Tue, 26 Mar 2024 16:02:03 +0000 (09:02 -0700)
commitf37c4eac99c258111d414d31b740437e1925b8e8
treee7b4482d503c8715a10f07fe11c11b12bb42fa05
parenteb58c598ce45b7e787568fe27016260417c3d807
i40e: fix vf may be used uninitialized in this function warning

To fix the regression introduced by commit 52424f974bc5, which causes
servers hang in very hard to reproduce conditions with resets races.
Using two sources for the information is the root cause.
In this function before the fix bumping v didn't mean bumping vf
pointer. But the code used this variables interchangeably, so stale vf
could point to different/not intended vf.

Remove redundant "v" variable and iterate via single VF pointer across
whole function instead to guarantee VF pointer validity.

Fixes: 52424f974bc5 ("i40e: Fix VF hang when reset is triggered on another VF")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c