提交 9c90a9f6 编写于 作者: J Johannes Berg

nl80211: remove bogus genlmsg_end() error checking

genlmsg_end() can't return an error since it returns the
skb length so remove checks treating the return value as
an error code.
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 d6d23de2
...@@ -9848,7 +9848,6 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, ...@@ -9848,7 +9848,6 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
int err;
u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid);
if (!nlportid) if (!nlportid)
...@@ -9869,12 +9868,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, ...@@ -9869,12 +9868,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd,
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr))
goto nla_put_failure; goto nla_put_failure;
err = genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
if (err < 0) {
nlmsg_free(msg);
return true;
}
genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid);
return true; return true;
...@@ -10317,10 +10311,7 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev, ...@@ -10317,10 +10311,7 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev,
if (nl80211_send_chandef(msg, chandef)) if (nl80211_send_chandef(msg, chandef))
goto nla_put_failure; goto nla_put_failure;
if (genlmsg_end(msg, hdr) < 0) { genlmsg_end(msg, hdr);
nlmsg_free(msg);
return;
}
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, gfp); nl80211_mlme_mcgrp.id, gfp);
...@@ -10386,7 +10377,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, ...@@ -10386,7 +10377,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
int err;
trace_cfg80211_probe_status(dev, addr, cookie, acked); trace_cfg80211_probe_status(dev, addr, cookie, acked);
...@@ -10408,11 +10398,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, ...@@ -10408,11 +10398,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
(acked && nla_put_flag(msg, NL80211_ATTR_ACK))) (acked && nla_put_flag(msg, NL80211_ATTR_ACK)))
goto nla_put_failure; goto nla_put_failure;
err = genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
if (err < 0) {
nlmsg_free(msg);
return;
}
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, gfp); nl80211_mlme_mcgrp.id, gfp);
...@@ -10478,7 +10464,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, ...@@ -10478,7 +10464,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
int err, size = 200; int size = 200;
trace_cfg80211_report_wowlan_wakeup(wdev->wiphy, wdev, wakeup); trace_cfg80211_report_wowlan_wakeup(wdev->wiphy, wdev, wakeup);
...@@ -10564,9 +10550,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, ...@@ -10564,9 +10550,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev,
nla_nest_end(msg, reasons); nla_nest_end(msg, reasons);
} }
err = genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
if (err < 0)
goto free_msg;
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, gfp); nl80211_mlme_mcgrp.id, gfp);
...@@ -10586,7 +10570,6 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, ...@@ -10586,7 +10570,6 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy);
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
int err;
trace_cfg80211_tdls_oper_request(wdev->wiphy, dev, peer, oper, trace_cfg80211_tdls_oper_request(wdev->wiphy, dev, peer, oper,
reason_code); reason_code);
...@@ -10609,11 +10592,7 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, ...@@ -10609,11 +10592,7 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer,
nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code))) nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code)))
goto nla_put_failure; goto nla_put_failure;
err = genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
if (err < 0) {
nlmsg_free(msg);
return;
}
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, gfp); nl80211_mlme_mcgrp.id, gfp);
...@@ -10671,7 +10650,6 @@ void cfg80211_ft_event(struct net_device *netdev, ...@@ -10671,7 +10650,6 @@ void cfg80211_ft_event(struct net_device *netdev,
struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy);
struct sk_buff *msg; struct sk_buff *msg;
void *hdr; void *hdr;
int err;
trace_cfg80211_ft_event(wiphy, netdev, ft_event); trace_cfg80211_ft_event(wiphy, netdev, ft_event);
...@@ -10697,11 +10675,7 @@ void cfg80211_ft_event(struct net_device *netdev, ...@@ -10697,11 +10675,7 @@ void cfg80211_ft_event(struct net_device *netdev,
nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len,
ft_event->ric_ies); ft_event->ric_ies);
err = genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
if (err < 0) {
nlmsg_free(msg);
return;
}
genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0,
nl80211_mlme_mcgrp.id, GFP_KERNEL); nl80211_mlme_mcgrp.id, GFP_KERNEL);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册