liquidio: fix PF falsely indicating success at setting MAC address of a nonexistent VF
Subsystems (3)
PATCH 1/1 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 <[email protected]>
Signed-off-by Derek Chickles <[email protected]>
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/net/ethernet/cavium/liquidio/lio_main.c +3 -0
@@ -3694,6 +3694,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);
From: Felix Manlunas <[email protected]>
Date: Tue, 16 May 2017 11:28:00 -0700
Quoted 6 lines
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 <[email protected]>Signed-off-by Derek Chickles <[email protected]>
Applied.