]> git.baikalelectronics.ru Git - kernel.git/commit
net: hns3: fix desc filling bug when skb is expanded or lineared
authorYunsheng Lin <linyunsheng@huawei.com>
Tue, 28 Jul 2020 02:16:48 +0000 (10:16 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 28 Jul 2020 19:54:48 +0000 (12:54 -0700)
commit45b4f70224cbaf1dd43c7ba37b2031dfc3ab662f
treebcd6dd56614f7d4728445ff1b0f9f8929e143f69
parent0df02e830e3b3fe67c60d8a456557baf3dce163d
net: hns3: fix desc filling bug when skb is expanded or lineared

The linear and frag data part may be changed when the skb is expanded
or lineared in skb_cow_head() or skb_checksum_help(), which is called
by hns3_fill_skb_desc(), so the linear len return by skb_headlen()
before the calling of hns3_fill_skb_desc() is unreliable.

Move hns3_fill_skb_desc() before the calling of skb_headlen() to fix
this bug.

Fixes: 6e2406330b28 ("net: hns3: Add support of HNS3 Ethernet Driver for hip08 SoC")
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c