[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1374267394-27697-6-git-send-email-sucheta.chakraborty@qlogic.com>
Date: Fri, 19 Jul 2013 16:56:30 -0400
From: Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
To: <davem@...emloft.net>
CC: <netdev@...r.kernel.org>, <Dept_NX_Linux_NIC_Driver@...gic.com>,
Manish Chopra <manish.chopra@...gic.com>
Subject: [PATCH net 5/9] qlcnic: Fix panic while setting VF's MAC address
From: Manish Chopra <manish.chopra@...gic.com>
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@...gic.com>
Signed-off-by: Sucheta Chakraborty <sucheta.chakraborty@...gic.com>
---
.../net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
index ee0c1d3..b9b88f3 100644
--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
+++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_sriov_pf.c
@@ -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;
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists