]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 10 Apr 2024 14:19:40 +0000 (16:19 +0200)
commit951d2748a2a8242853abc3d0c153ce4bf8faad31
treeec249e19dcea61afc240736718cbb0d44a8c2b94
parent8db472e17dec31da1a0a53f769f634f07e15e152
i40e: fix vf may be used uninitialized in this function warning

commit f37c4eac99c258111d414d31b740437e1925b8e8 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c