Skip to content

Commit

Permalink
mac80211: fix ieee80211_rx_bss_put/get imbalance
Browse files Browse the repository at this point in the history
This patch fixes iee80211_rx_bss_put/get imbalance
introduced by 'mac80211: enable IBSS merging' patch.

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Tomas Winkler authored and John W. Linville committed May 28, 2008
1 parent 679fda1 commit 167ad6f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions net/mac80211/mlme.c
Original file line number Diff line number Diff line change
Expand Up @@ -2479,8 +2479,6 @@ static int ieee80211_sta_join_ibss(struct net_device *dev,
ifsta->state = IEEE80211_IBSS_JOINED;
mod_timer(&ifsta->timer, jiffies + IEEE80211_IBSS_MERGE_INTERVAL);

ieee80211_rx_bss_put(dev, bss);

return res;
}

Expand Down Expand Up @@ -3523,6 +3521,7 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
struct ieee80211_supported_band *sband;
u8 bssid[ETH_ALEN], *pos;
int i;
int ret;
DECLARE_MAC_BUF(mac);

#if 0
Expand Down Expand Up @@ -3567,7 +3566,9 @@ static int ieee80211_sta_create_ibss(struct net_device *dev,
*pos++ = (u8) (rate / 5);
}

return ieee80211_sta_join_ibss(dev, ifsta, bss);
ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
ieee80211_rx_bss_put(dev, bss);
return ret;
}


Expand Down Expand Up @@ -3615,10 +3616,13 @@ static int ieee80211_sta_find_ibss(struct net_device *dev,
(bss = ieee80211_rx_bss_get(dev, bssid,
local->hw.conf.channel->center_freq,
ifsta->ssid, ifsta->ssid_len))) {
int ret;
printk(KERN_DEBUG "%s: Selected IBSS BSSID %s"
" based on configured SSID\n",
dev->name, print_mac(mac, bssid));
return ieee80211_sta_join_ibss(dev, ifsta, bss);
ret = ieee80211_sta_join_ibss(dev, ifsta, bss);
ieee80211_rx_bss_put(dev, bss);
return ret;
}
#ifdef CONFIG_MAC80211_IBSS_DEBUG
printk(KERN_DEBUG " did not try to join ibss\n");
Expand Down

0 comments on commit 167ad6f

Please sign in to comment.