Commit cab150b5 authored by Manish Chopra's avatar Manish Chopra Committed by David S. Miller

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: default avatarManish Chopra <manish.chopra@qlogic.com>
Signed-off-by: default avatarSucheta Chakraborty <sucheta.chakraborty@qlogic.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8dc394af
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment