diff options
Diffstat (limited to 'net/bridge/br_netlink.c')
-rw-r--r-- | net/bridge/br_netlink.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/net/bridge/br_netlink.c b/net/bridge/br_netlink.c index a9139682c49b..7d68b24b5654 100644 --- a/net/bridge/br_netlink.c +++ b/net/bridge/br_netlink.c | |||
@@ -45,7 +45,7 @@ static int br_fill_ifinfo(struct sk_buff *skb, const struct net_bridge_port *por | |||
45 | 45 | ||
46 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*hdr), flags); | 46 | nlh = nlmsg_put(skb, pid, seq, event, sizeof(*hdr), flags); |
47 | if (nlh == NULL) | 47 | if (nlh == NULL) |
48 | return -ENOBUFS; | 48 | return -EMSGSIZE; |
49 | 49 | ||
50 | hdr = nlmsg_data(nlh); | 50 | hdr = nlmsg_data(nlh); |
51 | hdr->ifi_family = AF_BRIDGE; | 51 | hdr->ifi_family = AF_BRIDGE; |
@@ -72,7 +72,8 @@ static int br_fill_ifinfo(struct sk_buff *skb, const struct net_bridge_port *por | |||
72 | return nlmsg_end(skb, nlh); | 72 | return nlmsg_end(skb, nlh); |
73 | 73 | ||
74 | nla_put_failure: | 74 | nla_put_failure: |
75 | return nlmsg_cancel(skb, nlh); | 75 | nlmsg_cancel(skb, nlh); |
76 | return -EMSGSIZE; | ||
76 | } | 77 | } |
77 | 78 | ||
78 | /* | 79 | /* |
@@ -89,9 +90,12 @@ void br_ifinfo_notify(int event, struct net_bridge_port *port) | |||
89 | goto errout; | 90 | goto errout; |
90 | 91 | ||
91 | err = br_fill_ifinfo(skb, port, 0, 0, event, 0); | 92 | err = br_fill_ifinfo(skb, port, 0, 0, event, 0); |
92 | /* failure implies BUG in br_nlmsg_size() */ | 93 | if (err < 0) { |
93 | BUG_ON(err < 0); | 94 | /* -EMSGSIZE implies BUG in br_nlmsg_size() */ |
94 | 95 | WARN_ON(err == -EMSGSIZE); | |
96 | kfree_skb(skb); | ||
97 | goto errout; | ||
98 | } | ||
95 | err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); | 99 | err = rtnl_notify(skb, 0, RTNLGRP_LINK, NULL, GFP_ATOMIC); |
96 | errout: | 100 | errout: |
97 | if (err < 0) | 101 | if (err < 0) |