summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2016-07-19 11:02:59 +0800
committerDavid S. Miller <davem@davemloft.net>2016-07-18 22:11:22 -0700
commit0d7eacbe637952fc737a968bc16db1f2ccbbe71c (patch)
treebae9ec84351a22aafda64962dd5ef90659cee9f2
parent2186f6eec2739ecd3944f9278e59edf0474f207c (diff)
downloadlinux-0d7eacbe637952fc737a968bc16db1f2ccbbe71c.tar.bz2
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 <dan.carpenter@oracle.com> Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/macvtap.c2
1 files changed, 1 insertions, 1 deletions
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)