Netdev List
 help / color / mirror / Atom feed
* [patch -next] dcb: use nlmsg_free() instead of kfree()
@ 2011-06-23  5:58 Dan Carpenter
  2011-06-23 10:14 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-06-23  5:58 UTC (permalink / raw)
  To: John Fastabend
  Cc: David S. Miller, Shmulik Ravid, open list:NETWORKING [GENERAL],
	kernel-janitors

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;
 	}
 

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [patch -next] dcb: use nlmsg_free() instead of kfree()
  2011-06-23  5:58 [patch -next] dcb: use nlmsg_free() instead of kfree() Dan Carpenter
@ 2011-06-23 10:14 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2011-06-23 10:14 UTC (permalink / raw)
  To: error27; +Cc: john.r.fastabend, shmulikr, netdev, kernel-janitors

From: Dan Carpenter <error27@gmail.com>
Date: Thu, 23 Jun 2011 08:58:02 +0300

> 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>

Applied, thanks Dan.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-06-23 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23  5:58 [patch -next] dcb: use nlmsg_free() instead of kfree() Dan Carpenter
2011-06-23 10:14 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox