Skip to content

Commit ac574b8

Browse files
321lipengdavem330
authored andcommitted
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>
1 parent 8be7362 commit ac574b8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3397,6 +3397,11 @@ static void hns3_fini_ring(struct hns3_enet_ring *ring)
33973397
ring->desc_cb = NULL;
33983398
ring->next_to_clean = 0;
33993399
ring->next_to_use = 0;
3400+
ring->pending_buf = 0;
3401+
if (ring->skb) {
3402+
dev_kfree_skb_any(ring->skb);
3403+
ring->skb = NULL;
3404+
}
34003405
}
34013406

34023407
static int hns3_buf_size2type(u32 buf_size)

0 commit comments

Comments
 (0)