Browse Source

wireless: Stop using NLA_PUT*().

These macros contain a hidden goto, and are thus extremely error
prone and make code hard to audit.

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 13 years ago
parent
commit
9360ffd185
2 changed files with 422 additions and 356 deletions
  1. 420 355
      net/wireless/nl80211.c
  2. 2 1
      net/wireless/wext-core.c

File diff suppressed because it is too large
+ 420 - 355
net/wireless/nl80211.c


+ 2 - 1
net/wireless/wext-core.c

@@ -402,7 +402,8 @@ static struct nlmsghdr *rtnetlink_ifinfo_prep(struct net_device *dev,
 	r->ifi_flags = dev_get_flags(dev);
 	r->ifi_flags = dev_get_flags(dev);
 	r->ifi_change = 0;	/* Wireless changes don't affect those flags */
 	r->ifi_change = 0;	/* Wireless changes don't affect those flags */
 
 
-	NLA_PUT_STRING(skb, IFLA_IFNAME, dev->name);
+	if (nla_put_string(skb, IFLA_IFNAME, dev->name))
+		goto nla_put_failure;
 
 
 	return nlh;
 	return nlh;
  nla_put_failure:
  nla_put_failure:

Some files were not shown because too many files changed in this diff