diff options
author | Kejian Yan <yankejian@huawei.com> | 2016-06-21 06:56:23 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-21 11:51:54 +0300 |
commit | 8379f0a8ea84f1a904e116b65751681a48a763ea (patch) | |
tree | 660430536c5742b7a2dea891c6bbc1aba6f80d9e /drivers/net/ethernet/hisilicon | |
parent | 14ae335a8599d735d19f600c29c6249dd2c3f7a8 (diff) | |
download | linux-8379f0a8ea84f1a904e116b65751681a48a763ea.tar.xz |
net: hns: add skb_reset_mac_header() after skb being alloc
HNS receives a packet without doing anything, but it should call
skb_reset_mac_header() to initialize the header before using
eth_hdr().
Fixes: 0d6b425a3773c3445b0f51b2f333821beaacb619
Signed-off-by: Kejian Yan <yankejian@huawei.com>
Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon')
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns/hns_enet.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c index ad742a6f5879..15200e4cd456 100644 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c @@ -600,6 +600,7 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data, ring->stats.sw_err_cnt++; return -ENOMEM; } + skb_reset_mac_header(skb); prefetchw(skb->data); length = le16_to_cpu(desc->rx.pkt_len); |