From patchwork Wed Dec 20 02:37:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Korenblit, Miriam Rachel" X-Patchwork-Id: 13498033 X-Patchwork-Delegate: johannes@sipsolutions.net Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D8AB412B6E for ; Tue, 19 Dec 2023 08:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="U4BfNAJa" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1702975081; x=1734511081; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=HolYsQQEjdh4HlceIG2Cu0d76Gt1uHG0/bSaISUlBWs=; b=U4BfNAJahHcpC4h9rtINgMfW5GJM3oCR6yDxqhNyGgqxhgf55ImJ/1vI qHhqQInHqEgbGb0tPwy7TI3Et8aLXJ/R9Vp1J8v9iLggSJvifJfc0ci1F NfpKuGQhh4sDaLGShRV6Fa9FQpPAiTRsnZ6sgZI+T+tUjUyrBYxFnyP5w GqQW/yQx1gr8qplTqp72zdtqLLoKIhUPt8+Z/XGrtDoTJ7oj8m97sSBhT URw53ApnECFhiHh7KTgXwcYsTaiIk9XGyQNMaCIZa1gwjWsrC5zdIPgft GYGKSpkm9JBDKzadoiecWQJ1sbipV8Q0k0io4lWJp0LQHER8078HErpmw Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="459969221" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="459969221" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 00:38:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10928"; a="846266404" X-IronPort-AV: E=Sophos;i="6.04,287,1695711600"; d="scan'208";a="846266404" Received: from unknown (HELO WEIS0040.iil.intel.com) ([10.12.217.108]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Dec 2023 00:37:59 -0800 From: Miri Korenblit To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Benjamin Berg , Berg, Johannes Subject: [PATCH 08/15] wifi: cfg80211: free beacon_ies when overridden from hidden BSS Date: Wed, 20 Dec 2023 04:37:56 +0200 Message-Id: <20231220043149.f17f858f389b.Id8c4c10aedd176ef2e18a4cad747b299f150f9df@changeid> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231220023803.2901117-1-miriam.rachel.korenblit@intel.com> References: <20231220023803.2901117-1-miriam.rachel.korenblit@intel.com> Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Organization: Intel Israel (74) Limited From: Benjamin Berg This is a more of a cosmetic fix. The branch will only be taken if proberesp_ies is set, which implies that beacon_ies is not set unless we are connected to an AP that just did a channel switch. And, in that case we should have found the BSS in the internal storage to begin with. Signed-off-by: Benjamin Berg Reviewed-by: Berg, Johannes Signed-off-by: Miri Korenblit --- net/wireless/scan.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index a601f1c7f835..68ba446067ac 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1871,8 +1871,12 @@ __cfg80211_bss_update(struct cfg80211_registered_device *rdev, list_add(&new->hidden_list, &hidden->hidden_list); hidden->refcount++; + + ies = (void *)rcu_dereference(new->pub.beacon_ies); rcu_assign_pointer(new->pub.beacon_ies, hidden->pub.beacon_ies); + if (ies) + kfree_rcu(ies, rcu_head); } } else { /*