Explorar o código

dcb: use nlmsg_free() instead of kfree()

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>
Dan Carpenter %!s(int64=14) %!d(string=hai) anos
pai
achega
4d054f2f14
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      net/dcb/dcbnl.c

+ 2 - 2
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);
 	nlh = nlmsg_put(skb, pid, 0, event, sizeof(*dcb), 0);
 	if (nlh == NULL) {
 	if (nlh == NULL) {
-		kfree(skb);
+		nlmsg_free(skb);
 		return -EMSGSIZE;
 		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);
 	nlh = nlmsg_put(skb, pid, seq, RTM_GETDCB, sizeof(*dcb), flags);
 	if (nlh == NULL) {
 	if (nlh == NULL) {
-		kfree(skb);
+		nlmsg_free(skb);
 		return -EMSGSIZE;
 		return -EMSGSIZE;
 	}
 	}