diff options
author | David S. Miller <davem@davemloft.net> | 2012-04-01 21:03:44 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-04-02 04:33:45 -0400 |
commit | 9d83ba4b6c6625de038f03cee18dd7bd89cee69b (patch) | |
tree | 639cdcee97b809313c9236fac1ec20fce86874b8 /drivers/net/wireless | |
parent | 633c938940cdb79d2a9e54f411f6c26ff09b451b (diff) |
wl12xx: 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>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/wl12xx/testmode.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c index 1e93bb9c024..b41428f5b3b 100644 --- a/drivers/net/wireless/wl12xx/testmode.c +++ b/drivers/net/wireless/wl12xx/testmode.c | |||
@@ -116,7 +116,8 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[]) | |||
116 | goto out_sleep; | 116 | goto out_sleep; |
117 | } | 117 | } |
118 | 118 | ||
119 | NLA_PUT(skb, WL1271_TM_ATTR_DATA, buf_len, buf); | 119 | if (nla_put(skb, WL1271_TM_ATTR_DATA, buf_len, buf)) |
120 | goto nla_put_failure; | ||
120 | ret = cfg80211_testmode_reply(skb); | 121 | ret = cfg80211_testmode_reply(skb); |
121 | if (ret < 0) | 122 | if (ret < 0) |
122 | goto out_sleep; | 123 | goto out_sleep; |
@@ -178,7 +179,8 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]) | |||
178 | goto out_free; | 179 | goto out_free; |
179 | } | 180 | } |
180 | 181 | ||
181 | NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd); | 182 | if (nla_put(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd)) |
183 | goto nla_put_failure; | ||
182 | ret = cfg80211_testmode_reply(skb); | 184 | ret = cfg80211_testmode_reply(skb); |
183 | if (ret < 0) | 185 | if (ret < 0) |
184 | goto out_free; | 186 | goto out_free; |
@@ -297,7 +299,8 @@ static int wl12xx_tm_cmd_get_mac(struct wl1271 *wl, struct nlattr *tb[]) | |||
297 | goto out; | 299 | goto out; |
298 | } | 300 | } |
299 | 301 | ||
300 | NLA_PUT(skb, WL1271_TM_ATTR_DATA, ETH_ALEN, mac_addr); | 302 | if (nla_put(skb, WL1271_TM_ATTR_DATA, ETH_ALEN, mac_addr)) |
303 | goto nla_put_failure; | ||
301 | ret = cfg80211_testmode_reply(skb); | 304 | ret = cfg80211_testmode_reply(skb); |
302 | if (ret < 0) | 305 | if (ret < 0) |
303 | goto out; | 306 | goto out; |