mirror of https://gitee.com/openkylin/linux.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: 0d6b425a37
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>
This commit is contained in:
parent
14ae335a85
commit
8379f0a8ea
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue