aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/qlcnic/qlcnic_main.c
diff options
context:
space:
mode:
authorRajesh Borundia <rajesh.borundia@qlogic.com>2010-08-31 13:17:49 -0400
committerDavid S. Miller <davem@davemloft.net>2010-09-01 13:41:56 -0400
commitdcb50afff747d15fc2ffff762c08c325e4c229e5 (patch)
tree374b6c5d42c9ce065c7c6082cd5e62a2726bca99 /drivers/net/qlcnic/qlcnic_main.c
parent7613c87b2d805acf7c882935d47aa84d1947656f (diff)
qlcnic: fix panic while using eth_hdr
o skb->mac_header is not set, so machine panics while using function eth_hdr. Signed-off-by: Rajesh Borundia <rajesh.borundia@qlogic.com> Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic/qlcnic_main.c')
-rw-r--r--drivers/net/qlcnic/qlcnic_main.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/qlcnic/qlcnic_main.c b/drivers/net/qlcnic/qlcnic_main.c
index 9a3ebb8a8203..789fe817cfca 100644
--- a/drivers/net/qlcnic/qlcnic_main.c
+++ b/drivers/net/qlcnic/qlcnic_main.c
@@ -1991,6 +1991,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
1991 struct qlcnic_skb_frag *buffrag; 1991 struct qlcnic_skb_frag *buffrag;
1992 struct cmd_desc_type0 *hwdesc, *first_desc; 1992 struct cmd_desc_type0 *hwdesc, *first_desc;
1993 struct pci_dev *pdev; 1993 struct pci_dev *pdev;
1994 struct ethhdr *phdr;
1994 int i, k; 1995 int i, k;
1995 1996
1996 u32 producer; 1997 u32 producer;
@@ -2003,7 +2004,8 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2003 } 2004 }
2004 2005
2005 if (adapter->flags & QLCNIC_MACSPOOF) { 2006 if (adapter->flags & QLCNIC_MACSPOOF) {
2006 if (compare_ether_addr(eth_hdr(skb)->h_source, 2007 phdr = (struct ethhdr *)skb->data;
2008 if (compare_ether_addr(phdr->h_source,
2007 adapter->mac_addr)) 2009 adapter->mac_addr))
2008 goto drop_packet; 2010 goto drop_packet;
2009 } 2011 }