aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeng Li2019-01-23 07:39:33 +0800
committerDavid S. Miller2019-01-23 11:13:01 -0800
commitac574b80a1ba834be01932d8cd4976acda775a36 (patch)
tree0de80e9f4bfaeb2f8fd567eb491349f66f4ee8c4
parent8be7362186bd5ccb5f6f72be49751ad2778e2636 (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.c5
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)