From patchwork Tue Sep 29 22:09:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 50615 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8TM9vNw012102 for ; Tue, 29 Sep 2009 22:09:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbZI2WJw (ORCPT ); Tue, 29 Sep 2009 18:09:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752180AbZI2WJw (ORCPT ); Tue, 29 Sep 2009 18:09:52 -0400 Received: from xc.sipsolutions.net ([83.246.72.84]:44243 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751510AbZI2WJw (ORCPT ); Tue, 29 Sep 2009 18:09:52 -0400 Received: by sipsolutions.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MsktP-0002EY-E3; Wed, 30 Sep 2009 00:09:55 +0200 Subject: [PATCH] mac80211: fix BSS leak From: Johannes Berg To: John Linville Cc: linux-wireless Date: Wed, 30 Sep 2009 00:09:25 +0200 Message-Id: <1254262165.30589.25.camel@johannes.local> Mime-Version: 1.0 X-Mailer: Evolution 2.28.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- wireless-testing.orig/net/mac80211/ibss.c 2009-09-30 00:05:12.000000000 +0200 +++ wireless-testing/net/mac80211/ibss.c 2009-09-30 00:08:18.000000000 +0200 @@ -73,6 +73,7 @@ static void __ieee80211_sta_join_ibss(st struct ieee80211_mgmt *mgmt; u8 *pos; struct ieee80211_supported_band *sband; + struct cfg80211_bss *bss; u32 bss_change; u8 supp_rates[IEEE80211_MAX_SUPP_RATES]; @@ -177,8 +178,9 @@ static void __ieee80211_sta_join_ibss(st mod_timer(&ifibss->timer, round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); - cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel, - mgmt, skb->len, 0, GFP_KERNEL); + bss = cfg80211_inform_bss_frame(local->hw.wiphy, local->hw.conf.channel, + mgmt, skb->len, 0, GFP_KERNEL); + cfg80211_put_bss(bss); cfg80211_ibss_joined(sdata->dev, ifibss->bssid, GFP_KERNEL); }