mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-12 19:46:29 +00:00
i40e: potential array underflow in i40e_vc_process_vf_msg()
If "vf_id" is smaller than hw->func_caps.vf_base_id then it leads to
an array underflow of the pf->vf[] array. This is unlikely to happen
unless the hardware is bad, but it's a small change and it silences a
static checker warning.
Fixes: 7efa84b7ab
('i40e: support VFs on PFs other than 0')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Tested-by: Sibai Li <sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
This commit is contained in:
parent
ff40dd5d44
commit
c243e96335
1 changed files with 1 additions and 1 deletions
|
@ -1774,7 +1774,7 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, u16 vf_id, u32 v_opcode,
|
||||||
u32 v_retval, u8 *msg, u16 msglen)
|
u32 v_retval, u8 *msg, u16 msglen)
|
||||||
{
|
{
|
||||||
struct i40e_hw *hw = &pf->hw;
|
struct i40e_hw *hw = &pf->hw;
|
||||||
int local_vf_id = vf_id - hw->func_caps.vf_base_id;
|
unsigned int local_vf_id = vf_id - hw->func_caps.vf_base_id;
|
||||||
struct i40e_vf *vf;
|
struct i40e_vf *vf;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue