forked from Minki/linux
liquidio: fix PF falsely indicating success at setting MAC address of a nonexistent VF
In the function assigned to .ndo_set_vf_mac, check the validity of the vfidx argument before proceeding to tell the firmware to set the VF MAC address. Signed-off-by: Felix Manlunas <felix.manlunas@cavium.com> Signed-off-by: Derek Chickles <derek.chickles@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
e1e3ce6236
commit
0d9a599784
@ -3698,6 +3698,9 @@ static int liquidio_set_vf_mac(struct net_device *netdev, int vfidx, u8 *mac)
|
||||
struct octeon_device *oct = lio->oct_dev;
|
||||
int retval;
|
||||
|
||||
if (vfidx < 0 || vfidx >= oct->sriov_info.num_vfs_alloced)
|
||||
return -EINVAL;
|
||||
|
||||
retval = __liquidio_set_vf_mac(netdev, vfidx, mac, true);
|
||||
if (!retval)
|
||||
cn23xx_tell_vf_its_macaddr_changed(oct, vfidx, mac);
|
||||
|
Loading…
Reference in New Issue
Block a user