From: Kejian Yan Date: Tue, 21 Jun 2016 03:56:23 +0000 (+0800) Subject: net: hns: add skb_reset_mac_header() after skb being alloc X-Git-Tag: Ubuntu-5.0.0-8.9~6810^2~292^2~16 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8379f0a8ea84f1a904e116b65751681a48a763ea;p=mirror_ubuntu-disco-kernel.git 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 Signed-off-by: Yisen Zhuang Signed-off-by: David S. Miller --- 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);