summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ath/ath6kl/testmode.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-04-02 05:02:53 +0400
committerDavid S. Miller <davem@davemloft.net>2012-04-02 12:33:44 +0400
commit7b69549a0f2cd0822fa5d26be3424ba267150d92 (patch)
tree93304c29c3b0786b07edb4e02e0f26b63fee5516 /drivers/net/wireless/ath/ath6kl/testmode.c
parent61849dda1dd4ee286521fdfde388dcfc1d891bad (diff)
downloadlinux-7b69549a0f2cd0822fa5d26be3424ba267150d92.tar.xz
ath6kl: 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/ath/ath6kl/testmode.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/testmode.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/testmode.c b/drivers/net/wireless/ath/ath6kl/testmode.c
index 6675c92b542b..acc9aa832f76 100644
--- a/drivers/net/wireless/ath/ath6kl/testmode.c
+++ b/drivers/net/wireless/ath/ath6kl/testmode.c
@@ -55,8 +55,9 @@ void ath6kl_tm_rx_event(struct ath6kl *ar, void *buf, size_t buf_len)
ath6kl_warn("failed to allocate testmode rx skb!\n");
return;
}
- NLA_PUT_U32(skb, ATH6KL_TM_ATTR_CMD, ATH6KL_TM_CMD_TCMD);
- NLA_PUT(skb, ATH6KL_TM_ATTR_DATA, buf_len, buf);
+ if (nla_put_u32(skb, ATH6KL_TM_ATTR_CMD, ATH6KL_TM_CMD_TCMD) ||
+ nla_put(skb, ATH6KL_TM_ATTR_DATA, buf_len, buf))
+ goto nla_put_failure;
cfg80211_testmode_event(skb, GFP_KERNEL);
return;