On Tue, Dec 3, 2013 at 8:00 PM, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote: > On Sun, 2013-12-01 at 13:01 +0530, Ujjal Roy wrote: > >> + if (!bss) >> + save_bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, >> + wdev->ssid, wdev->ssid_len, >> + WLAN_CAPABILITY_ESS, >> + WLAN_CAPABILITY_ESS); >> if (wdev->current_bss) { >> cfg80211_unhold_bss(wdev->current_bss); >> cfg80211_put_bss(wdev->wiphy, &wdev->current_bss->pub); >> @@ -651,10 +657,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid, >> >> if (!bss) { >> WARN_ON_ONCE(!wiphy_to_dev(wdev->wiphy)->ops->connect); >> - bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid, >> - wdev->ssid, wdev->ssid_len, >> - WLAN_CAPABILITY_ESS, >> - WLAN_CAPABILITY_ESS); >> + bss = save_bss; > > In an unsuccessful result case, this leaks the BSS struct. I'd prefer to > reshuffle the code a bit to not need a separate save_bss variable, but I > don't immediately see an easy way to do that. > > johannes > Thanks for pointing out the leak of BSS. I have reshuffled the code to avoid an extra variable. Please have a look at this code which I am sending through git send-mail. -- Thanks, UjjaL Roy -- 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