macvtap: correctly free skb during socket destruction
authorJason Wang <jasowang@redhat.com>
Tue, 19 Jul 2016 03:02:59 +0000 (11:02 +0800)
committerDavid S. Miller <davem@davemloft.net>
Tue, 19 Jul 2016 05:11:22 +0000 (22:11 -0700)
We should use kfree_skb() instead of kfree() to free an skb.

Fixes: 362899b8725b ("macvtap: switch to use skb array")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/macvtap.c

index 9204d19fb30c2032cadccb1c70bfcafe4c4dd38f..a38c0dac514b89b1a9e7ab8d23e2b4aa56e07565 100644 (file)
@@ -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)