Skip to content

Commit

Permalink
dcb: use nlmsg_free() instead of kfree()
Browse files Browse the repository at this point in the history
These sk_buff structs were allocated with nlmsg_new() so they should
be freed with nlmsg_free().

Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
error27 authored and davem330 committed Jun 23, 2011
1 parent 655f891 commit 4d054f2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/dcb/dcbnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand Down

0 comments on commit 4d054f2

Please sign in to comment.