Search Linux Wireless

RE: [PATCH] cfg80211: annotate cfg80211_inform_bss

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Johannes,

> -----Original Message-----
> From: linux-wireless-owner@xxxxxxxxxxxxxxx [mailto:linux-wireless-owner@xxxxxxxxxxxxxxx] On Behalf Of
> Johannes Berg
> Sent: Thursday, October 27, 2011 5:45 AM
> To: John Linville
> Cc: linux-wireless; Samuel Ortiz; Bing Zhao; Jussi Kivilinna; Dan Williams; Arend Van Spriel
> Subject: [PATCH] cfg80211: annotate cfg80211_inform_bss
> 
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
> 
> 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@xxxxxxxxx>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
> CC lots of driver maintainers who need to fix this bug.

I will work on the mwifiex driver part.

Thanks,
Bing

> 
>  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,
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux