mirror of
https://github.com/FEX-Emu/linux.git
synced 2025-01-07 01:51:42 +00:00
qlcnic: Fix panic while setting VF's MAC address
o "qlcnic_sriov" structure pointer should be accessed only when SR-IOV is enabled. Access this pointer after SR-IOV PF check. Signed-off-by: Manish Chopra <manish.chopra@qlogic.com> Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8dc394af2e
commit
cab150b587
@ -1621,13 +1621,15 @@ int qlcnic_sriov_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
|
||||
{
|
||||
struct qlcnic_adapter *adapter = netdev_priv(netdev);
|
||||
struct qlcnic_sriov *sriov = adapter->ahw->sriov;
|
||||
int i, num_vfs = sriov->num_vfs;
|
||||
int i, num_vfs;
|
||||
struct qlcnic_vf_info *vf_info;
|
||||
u8 *curr_mac;
|
||||
|
||||
if (!qlcnic_sriov_pf_check(adapter))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
num_vfs = sriov->num_vfs;
|
||||
|
||||
if (!is_valid_ether_addr(mac) || vf >= num_vfs)
|
||||
return -EINVAL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user