diff options
author | Johannes Berg <johannes.berg@intel.com> | 2013-06-04 06:46:03 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-06-04 06:47:08 -0400 |
commit | 9c90a9f64c21b0a3983655c9c08cf98489057a43 (patch) | |
tree | f880fb4dec18eb1b0d8f9c4b8ae827ee5a8cba04 /net/wireless/nl80211.c | |
parent | d6d23de2786edca61fb9813ff7cdc7d2543d08a7 (diff) |
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: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/nl80211.c')
-rw-r--r-- | net/wireless/nl80211.c | 40 |
1 files changed, 7 insertions, 33 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 7ee9af3283a8..ce949e38178c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -9848,7 +9848,6 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
9848 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 9848 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
9849 | struct sk_buff *msg; | 9849 | struct sk_buff *msg; |
9850 | void *hdr; | 9850 | void *hdr; |
9851 | int err; | ||
9852 | u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); | 9851 | u32 nlportid = ACCESS_ONCE(wdev->ap_unexpected_nlportid); |
9853 | 9852 | ||
9854 | if (!nlportid) | 9853 | if (!nlportid) |
@@ -9869,12 +9868,7 @@ static bool __nl80211_unexpected_frame(struct net_device *dev, u8 cmd, | |||
9869 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) | 9868 | nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr)) |
9870 | goto nla_put_failure; | 9869 | goto nla_put_failure; |
9871 | 9870 | ||
9872 | err = genlmsg_end(msg, hdr); | 9871 | genlmsg_end(msg, hdr); |
9873 | if (err < 0) { | ||
9874 | nlmsg_free(msg); | ||
9875 | return true; | ||
9876 | } | ||
9877 | |||
9878 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); | 9872 | genlmsg_unicast(wiphy_net(&rdev->wiphy), msg, nlportid); |
9879 | return true; | 9873 | return true; |
9880 | 9874 | ||
@@ -10317,10 +10311,7 @@ nl80211_radar_notify(struct cfg80211_registered_device *rdev, | |||
10317 | if (nl80211_send_chandef(msg, chandef)) | 10311 | if (nl80211_send_chandef(msg, chandef)) |
10318 | goto nla_put_failure; | 10312 | goto nla_put_failure; |
10319 | 10313 | ||
10320 | if (genlmsg_end(msg, hdr) < 0) { | 10314 | genlmsg_end(msg, hdr); |
10321 | nlmsg_free(msg); | ||
10322 | return; | ||
10323 | } | ||
10324 | 10315 | ||
10325 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 10316 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10326 | nl80211_mlme_mcgrp.id, gfp); | 10317 | nl80211_mlme_mcgrp.id, gfp); |
@@ -10386,7 +10377,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
10386 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 10377 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
10387 | struct sk_buff *msg; | 10378 | struct sk_buff *msg; |
10388 | void *hdr; | 10379 | void *hdr; |
10389 | int err; | ||
10390 | 10380 | ||
10391 | trace_cfg80211_probe_status(dev, addr, cookie, acked); | 10381 | trace_cfg80211_probe_status(dev, addr, cookie, acked); |
10392 | 10382 | ||
@@ -10408,11 +10398,7 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
10408 | (acked && nla_put_flag(msg, NL80211_ATTR_ACK))) | 10398 | (acked && nla_put_flag(msg, NL80211_ATTR_ACK))) |
10409 | goto nla_put_failure; | 10399 | goto nla_put_failure; |
10410 | 10400 | ||
10411 | err = genlmsg_end(msg, hdr); | 10401 | genlmsg_end(msg, hdr); |
10412 | if (err < 0) { | ||
10413 | nlmsg_free(msg); | ||
10414 | return; | ||
10415 | } | ||
10416 | 10402 | ||
10417 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 10403 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10418 | nl80211_mlme_mcgrp.id, gfp); | 10404 | nl80211_mlme_mcgrp.id, gfp); |
@@ -10478,7 +10464,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
10478 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 10464 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
10479 | struct sk_buff *msg; | 10465 | struct sk_buff *msg; |
10480 | void *hdr; | 10466 | void *hdr; |
10481 | int err, size = 200; | 10467 | int size = 200; |
10482 | 10468 | ||
10483 | trace_cfg80211_report_wowlan_wakeup(wdev->wiphy, wdev, wakeup); | 10469 | trace_cfg80211_report_wowlan_wakeup(wdev->wiphy, wdev, wakeup); |
10484 | 10470 | ||
@@ -10564,9 +10550,7 @@ void cfg80211_report_wowlan_wakeup(struct wireless_dev *wdev, | |||
10564 | nla_nest_end(msg, reasons); | 10550 | nla_nest_end(msg, reasons); |
10565 | } | 10551 | } |
10566 | 10552 | ||
10567 | err = genlmsg_end(msg, hdr); | 10553 | genlmsg_end(msg, hdr); |
10568 | if (err < 0) | ||
10569 | goto free_msg; | ||
10570 | 10554 | ||
10571 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 10555 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10572 | nl80211_mlme_mcgrp.id, gfp); | 10556 | nl80211_mlme_mcgrp.id, gfp); |
@@ -10586,7 +10570,6 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | |||
10586 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | 10570 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); |
10587 | struct sk_buff *msg; | 10571 | struct sk_buff *msg; |
10588 | void *hdr; | 10572 | void *hdr; |
10589 | int err; | ||
10590 | 10573 | ||
10591 | trace_cfg80211_tdls_oper_request(wdev->wiphy, dev, peer, oper, | 10574 | trace_cfg80211_tdls_oper_request(wdev->wiphy, dev, peer, oper, |
10592 | reason_code); | 10575 | reason_code); |
@@ -10609,11 +10592,7 @@ void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | |||
10609 | nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code))) | 10592 | nla_put_u16(msg, NL80211_ATTR_REASON_CODE, reason_code))) |
10610 | goto nla_put_failure; | 10593 | goto nla_put_failure; |
10611 | 10594 | ||
10612 | err = genlmsg_end(msg, hdr); | 10595 | genlmsg_end(msg, hdr); |
10613 | if (err < 0) { | ||
10614 | nlmsg_free(msg); | ||
10615 | return; | ||
10616 | } | ||
10617 | 10596 | ||
10618 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 10597 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10619 | nl80211_mlme_mcgrp.id, gfp); | 10598 | nl80211_mlme_mcgrp.id, gfp); |
@@ -10671,7 +10650,6 @@ void cfg80211_ft_event(struct net_device *netdev, | |||
10671 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); | 10650 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wiphy); |
10672 | struct sk_buff *msg; | 10651 | struct sk_buff *msg; |
10673 | void *hdr; | 10652 | void *hdr; |
10674 | int err; | ||
10675 | 10653 | ||
10676 | trace_cfg80211_ft_event(wiphy, netdev, ft_event); | 10654 | trace_cfg80211_ft_event(wiphy, netdev, ft_event); |
10677 | 10655 | ||
@@ -10697,11 +10675,7 @@ void cfg80211_ft_event(struct net_device *netdev, | |||
10697 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, | 10675 | nla_put(msg, NL80211_ATTR_IE_RIC, ft_event->ric_ies_len, |
10698 | ft_event->ric_ies); | 10676 | ft_event->ric_ies); |
10699 | 10677 | ||
10700 | err = genlmsg_end(msg, hdr); | 10678 | genlmsg_end(msg, hdr); |
10701 | if (err < 0) { | ||
10702 | nlmsg_free(msg); | ||
10703 | return; | ||
10704 | } | ||
10705 | 10679 | ||
10706 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, | 10680 | genlmsg_multicast_netns(wiphy_net(&rdev->wiphy), msg, 0, |
10707 | nl80211_mlme_mcgrp.id, GFP_KERNEL); | 10681 | nl80211_mlme_mcgrp.id, GFP_KERNEL); |