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>
This commit is contained in:
Peng Li 2019-01-23 07:39:33 +08:00 committed by David S. Miller
parent 8be7362186
commit ac574b80a1
1 changed files with 5 additions and 0 deletions

View File

@ -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)