From c7f9267bef9ceee4d559889b6afe75337f753bee Mon Sep 17 00:00:00 2001 From: Shaozhengchao Date: Sat, 26 Oct 2019 14:57:53 +0800 Subject: [PATCH] net/hinic: fix tx padding bug driver inclusion category:bugfix bugzilla:4472 CVE:NA ----------------------------------------------------------------------- fix tx padding bug Signed-off-by: Shaozhengchao Reviewed-by: Wangxiaoyun Signed-off-by: Yang Yingliang --- drivers/net/ethernet/huawei/hinic/hinic_tx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/huawei/hinic/hinic_tx.c b/drivers/net/ethernet/huawei/hinic/hinic_tx.c index dcc48847d8ef..53ee3f1b2045 100644 --- a/drivers/net/ethernet/huawei/hinic/hinic_tx.c +++ b/drivers/net/ethernet/huawei/hinic/hinic_tx.c @@ -782,7 +782,6 @@ static netdev_tx_t hinic_send_one_skb(struct sk_buff *skb, u16 pi = 0; int err, wqebb_cnt; u16 num_sge = 0; - u16 skb_nr_frags = skb_shinfo(skb)->nr_frags; /* skb->dev will not initialized when calling netdev_alloc_skb_ip_align * and parameter of length is largger then PAGE_SIZE(under redhat7.3), @@ -800,7 +799,7 @@ static netdev_tx_t hinic_send_one_skb(struct sk_buff *skb, skb->len = MIN_SKB_LEN; } - num_sge = skb_nr_frags + 1; + num_sge = skb_shinfo(skb)->nr_frags + 1; /* if skb->len is more than 65536B but num_sge is 1, * driver will drop it -- GitLab