Re: [PATCH 1/2] net/wireless/nl80211.c: Avoid call to genlmsg_cancel
From: Julia Lawall <hidden>
Date: 2011-01-28 14:17:00
Also in:
kernel-janitors, lkml, netdev
From: Julia Lawall <hidden>
Date: 2011-01-28 14:17:00
Also in:
kernel-janitors, lkml, netdev
On Fri, 28 Jan 2011, Johannes Berg wrote:
On Fri, 2011-01-28 at 15:17 +0100, Julia Lawall wrote:quoted
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 9b62710..864ddfb 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c@@ -2718,7 +2718,7 @@ static int nl80211_get_mesh_config(struct sk_buff *skb, hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, NL80211_CMD_GET_MESH_CONFIG); if (!hdr) - goto nla_put_failure; + goto out;quoted
@@ -2954,7 +2955,7 @@ static int nl80211_get_reg(struct sk_buff *skb, struct genl_info *info) hdr = nl80211hdr_put(msg, info->snd_pid, info->snd_seq, 0, NL80211_CMD_GET_REG); if (!hdr) - goto nla_put_failure; + goto put_failure; NLA_PUT_STRING(msg, NL80211_ATTR_REG_ALPHA2, cfg80211_regdomain->alpha2);Seems fine. Actually, since the message is freed anyhow, the call to genlmsg_cancel is *completely* unnecessary, I just put it in to make it nest better and not rely on it not having side effects. But why did you call the label differently? :)
Because out is already used in this case, and I didn't want to change all of the other occurrences of nla_put_failure. It's a bit sloppy though, because this code is the actual nla_put_failure. I can change it if you prefer. julia