Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] cfg80211: annotate cfg80211_inform_bss
@ 2011-10-27 12:45 Johannes Berg
  2011-10-27 19:40 ` Bing Zhao
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Johannes Berg @ 2011-10-27 12:45 UTC (permalink / raw)
  To: John Linville
  Cc: linux-wireless, Samuel Ortiz, Bing Zhao, Jussi Kivilinna,
	Dan Williams, Arend Van Spriel

From: Johannes Berg <johannes.berg@intel.com>

This function returns a referenced BSS struct
(or NULL), annotate with __must_check. It seems
that a lot of drivers get this completely wrong
and leak all BSS structs as a result.

Reported-by: Adam Mikuta <Adam.Mikuta@tieto.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
CC lots of driver maintainers who need to fix this bug.

 include/net/cfg80211.h |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

--- a/include/net/cfg80211.h	2011-10-27 14:05:17.000000000 +0200
+++ b/include/net/cfg80211.h	2011-10-27 14:42:51.000000000 +0200
@@ -2651,8 +2651,10 @@ void cfg80211_sched_scan_stopped(struct
  *
  * This informs cfg80211 that BSS information was found and
  * the BSS should be updated/added.
+ *
+ * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()!
  */
-struct cfg80211_bss*
+struct cfg80211_bss * __must_check
 cfg80211_inform_bss_frame(struct wiphy *wiphy,
 			  struct ieee80211_channel *channel,
 			  struct ieee80211_mgmt *mgmt, size_t len,
@@ -2674,8 +2676,10 @@ cfg80211_inform_bss_frame(struct wiphy *
  *
  * This informs cfg80211 that BSS information was found and
  * the BSS should be updated/added.
+ *
+ * NOTE: Returns a referenced struct, must be released with cfg80211_put_bss()!
  */
-struct cfg80211_bss*
+struct cfg80211_bss * __must_check
 cfg80211_inform_bss(struct wiphy *wiphy,
 		    struct ieee80211_channel *channel,
 		    const u8 *bssid,



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-10-28 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-27 12:45 [PATCH] cfg80211: annotate cfg80211_inform_bss Johannes Berg
2011-10-27 19:40 ` Bing Zhao
2011-10-28  5:05 ` [PATCH] rndis_wlan: release BSS structures returned by cfg80211_inform_bss() Jussi Kivilinna
2011-10-28 10:00 ` [PATCH] orinoco: " David Kilroy
2011-10-28 10:09   ` Johannes Berg
2011-10-28 11:47     ` [PATCH v2] " David Kilroy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox