提交 9d83ba4b 编写于 作者: D David S. Miller

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: NDavid S. Miller <davem@davemloft.net>
上级 633c9389
...@@ -116,7 +116,8 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[]) ...@@ -116,7 +116,8 @@ static int wl1271_tm_cmd_test(struct wl1271 *wl, struct nlattr *tb[])
goto out_sleep; goto out_sleep;
} }
NLA_PUT(skb, WL1271_TM_ATTR_DATA, buf_len, buf); if (nla_put(skb, WL1271_TM_ATTR_DATA, buf_len, buf))
goto nla_put_failure;
ret = cfg80211_testmode_reply(skb); ret = cfg80211_testmode_reply(skb);
if (ret < 0) if (ret < 0)
goto out_sleep; goto out_sleep;
...@@ -178,7 +179,8 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[]) ...@@ -178,7 +179,8 @@ static int wl1271_tm_cmd_interrogate(struct wl1271 *wl, struct nlattr *tb[])
goto out_free; goto out_free;
} }
NLA_PUT(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd); if (nla_put(skb, WL1271_TM_ATTR_DATA, sizeof(*cmd), cmd))
goto nla_put_failure;
ret = cfg80211_testmode_reply(skb); ret = cfg80211_testmode_reply(skb);
if (ret < 0) if (ret < 0)
goto out_free; goto out_free;
...@@ -297,7 +299,8 @@ static int wl12xx_tm_cmd_get_mac(struct wl1271 *wl, struct nlattr *tb[]) ...@@ -297,7 +299,8 @@ static int wl12xx_tm_cmd_get_mac(struct wl1271 *wl, struct nlattr *tb[])
goto out; goto out;
} }
NLA_PUT(skb, WL1271_TM_ATTR_DATA, ETH_ALEN, mac_addr); if (nla_put(skb, WL1271_TM_ATTR_DATA, ETH_ALEN, mac_addr))
goto nla_put_failure;
ret = cfg80211_testmode_reply(skb); ret = cfg80211_testmode_reply(skb);
if (ret < 0) if (ret < 0)
goto out; goto out;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册