dcb: use nlmsg_free() instead of kfree()
authorDan Carpenter <error27@gmail.com>
Thu, 23 Jun 2011 10:14:42 +0000 (03:14 -0700)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jun 2011 10:14:42 +0000 (03:14 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/dcb/dcbnl.c

index e954d4c6590c8af25f564ebd65cdde94f86a51e1..fc56e8546261510e863b4f6ac01c3c8504e2dc72 100644 (file)
@@ -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;
        }