From: Jason Wang <jasowang@redhat.com>
To: davem@davemloft.net, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: dan.carpenter@oracle.com, Jason Wang <jasowang@redhat.com>
Subject: [PATCH net-next] macvtap: correctly free skb during socket destruction
Date: Tue, 19 Jul 2016 11:02:59 +0800 [thread overview]
Message-ID: <1468897379-4373-1-git-send-email-jasowang@redhat.com> (raw)
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>
---
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 9204d19..a38c0da 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.7.4
next reply other threads:[~2016-07-19 3:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-19 3:02 Jason Wang [this message]
2016-07-19 5:11 ` [PATCH net-next] macvtap: correctly free skb during socket destruction David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1468897379-4373-1-git-send-email-jasowang@redhat.com \
--to=jasowang@redhat.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).