From: Dan Carpenter <error27@gmail.com>
To: John Fastabend <john.r.fastabend@intel.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Shmulik Ravid <shmulikr@broadcom.com>,
"open list:NETWORKING [GENERAL]" <netdev@vger.kernel.org>,
kernel-janitors@vger.kernel.org
Subject: [patch -next] dcb: use nlmsg_free() instead of kfree()
Date: Thu, 23 Jun 2011 08:58:02 +0300 [thread overview]
Message-ID: <20110623055802.GN14591@shale.localdomain> (raw)
These sk_buff structs were allocated with nlmsg_new() so they should
be freed with nlmsg_free().
Signed-off-by: Dan Carpenter <error27@gmail.com>
diff --git a/net/dcb/dcbnl.c b/net/dcb/dcbnl.c
index e954d4c..fc56e85 100644
--- a/net/dcb/dcbnl.c
+++ b/net/dcb/dcbnl.c
@@ -1329,7 +1329,7 @@ int dcbnl_notify(struct net_device *dev, int event, int cmd,
nlh = nlmsg_put(skb, pid, 0, event, sizeof(*dcb), 0);
if (nlh == NULL) {
- kfree(skb);
+ nlmsg_free(skb);
return -EMSGSIZE;
}
@@ -1434,7 +1434,7 @@ static int dcbnl_ieee_get(struct net_device *netdev, struct nlattr **tb,
nlh = nlmsg_put(skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
if (nlh == NULL) {
- kfree(skb);
+ nlmsg_free(skb);
return -EMSGSIZE;
}
next reply other threads:[~2011-06-23 5:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-23 5:58 Dan Carpenter [this message]
2011-06-23 10:14 ` [patch -next] dcb: use nlmsg_free() instead of kfree() 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=20110623055802.GN14591@shale.localdomain \
--to=error27@gmail.com \
--cc=davem@davemloft.net \
--cc=john.r.fastabend@intel.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shmulikr@broadcom.com \
/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