diff options
author | Peng Li | 2019-01-23 07:39:33 +0800 |
---|---|---|
committer | David S. Miller | 2019-01-23 11:13:01 -0800 |
commit | ac574b80a1ba834be01932d8cd4976acda775a36 (patch) | |
tree | 0de80e9f4bfaeb2f8fd567eb491349f66f4ee8c4 | |
parent | 8be7362186bd5ccb5f6f72be49751ad2778e2636 (diff) |
net: hns3: clear param in ring when free ring
Param pending_buf and skb may be not NULL when free ring.
This patch clears them when free ring.
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c index 544f0d2f1e12..327dde2765ab 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c @@ -3397,6 +3397,11 @@ static void hns3_fini_ring(struct hns3_enet_ring *ring) ring->desc_cb = NULL; ring->next_to_clean = 0; ring->next_to_use = 0; + ring->pending_buf = 0; + if (ring->skb) { + dev_kfree_skb_any(ring->skb); + ring->skb = NULL; + } } static int hns3_buf_size2type(u32 buf_size) |