From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from xc.sipsolutions.net ([83.246.72.84]:57214 "EHLO sipsolutions.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752204AbZDPKQR (ORCPT ); Thu, 16 Apr 2009 06:16:17 -0400 Subject: [PATCH 2.6.30] cfg80211: copy hold when replacing BSS From: Johannes Berg To: John Linville Cc: Kalle Valo , linux-wireless Content-Type: text/plain Date: Thu, 16 Apr 2009 12:15:38 +0200 Message-Id: <1239876938.9737.14.camel@johannes.local> (sfid-20090416_121620_410957_FA62E3F6) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: When we receive a probe response frame we can replace the BSS struct in our list -- but if that struct is held then we need to hold the new one as well. We really should fix this completely and not replace the struct, but this is a bandaid for now. Signed-off-by: Johannes Berg --- net/wireless/scan.c | 2 ++ 1 file changed, 2 insertions(+) --- wireless-testing.orig/net/wireless/scan.c 2009-04-16 12:12:08.000000000 +0200 +++ wireless-testing/net/wireless/scan.c 2009-04-16 12:12:21.000000000 +0200 @@ -364,6 +364,8 @@ cfg80211_bss_update(struct cfg80211_regi list_replace(&found->list, &res->list); rb_replace_node(&found->rbn, &res->rbn, &dev->bss_tree); + /* XXX: workaround */ + res->hold = found->hold; kref_put(&found->ref, bss_release); found = res; } else if (found) {