From 0d7eacbe637952fc737a968bc16db1f2ccbbe71c Mon Sep 17 00:00:00 2001 From: Jason Wang Date: Tue, 19 Jul 2016 11:02:59 +0800 Subject: [PATCH] macvtap: correctly free skb during socket destruction We should use kfree_skb() instead of kfree() to free an skb. Fixes: 362899b8725b ("macvtap: switch to use skb array") Reported-by: Dan Carpenter Signed-off-by: Jason Wang Signed-off-by: David S. Miller --- drivers/net/macvtap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 9204d19fb30c..a38c0dac514b 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c @@ -536,7 +536,7 @@ static void macvtap_sock_destruct(struct sock *sk) struct sk_buff *skb; while ((skb = skb_array_consume(&q->skb_array)) != NULL) - kfree(skb); + kfree_skb(skb); } static int macvtap_open(struct inode *inode, struct file *file) -- 2.30.2