From patchwork Thu Oct 13 17:41:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Berg X-Patchwork-Id: 13006257 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B3F2C4332F for ; Thu, 13 Oct 2022 17:42:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229716AbiJMRmC (ORCPT ); Thu, 13 Oct 2022 13:42:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50422 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229652AbiJMRmB (ORCPT ); Thu, 13 Oct 2022 13:42:01 -0400 Received: from sipsolutions.net (s3.sipsolutions.net [IPv6:2a01:4f8:191:4433::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9DE73DCAC4; Thu, 13 Oct 2022 10:41:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sipsolutions.net; s=mail; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Content-Type:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-To:Resent-Cc: Resent-Message-ID:In-Reply-To:References; bh=x7b71pQCQ6gNjHRAB0+aKfImMlMvzVpRwtk+NdAmaEQ=; t=1665682919; x=1666892519; b=Fxs/VEsGbdqPIF+AcWnoa/+3ZNMdhI/rxpxQfEwqcSQPq7j4TYPDcXgrbn8u77CNbORg2aReVWo qWwwUsANqSfHo4V4eAdodmlVy+2DaP4144scv+LdXsZL1A+wtBWY37GaYolWzHpkVxy0Hh/ofWfjt Eb22vnKTRxdAxZQb6fISPv0pDZAZVcbsf/A0NHVJdUI6qhTIoEdK13cUP/2rzadPwJmyBA2N3WYtJ 0d9aJMK5fuQy3eGgUF3K54CPssOUi2Xaat4MLsifrYaq39yRQcoRxBbzRPguXTYAoOrv0+8dMrEj2 7l4nGmh7sSCMZpOoZ1HzIXg6rnsW1XxCgDRw==; Received: by sipsolutions.net with esmtpsa (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.96) (envelope-from ) id 1oj2DT-005luD-2c; Thu, 13 Oct 2022 19:41:55 +0200 From: Johannes Berg To: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org, Jakub Kicinski , Johannes Berg Subject: [PATCH] wifi: cfg80211: silence a sparse RCU warning Date: Thu, 13 Oct 2022 19:41:51 +0200 Message-Id: <20221013194149.532913e897bd.I4e49ca6ce4248c0c4a9fa8c78e48ad91ab80c31c@changeid> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org From: Johannes Berg All we're going to do with this pointer is assign it to another __rcu pointer, but sparse can't see that, so use rcu_access_pointer() to silence the warning here. Fixes: c90b93b5b782 ("wifi: cfg80211: update hidden BSSes to avoid WARN_ON") Signed-off-by: Johannes Berg --- Sending it now anyway, just in case you might want to throw it into the tree before sending a PR to Linus. --- net/wireless/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 806a5f1330ff..da752b0cc752 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1674,7 +1674,9 @@ cfg80211_update_known_bss(struct cfg80211_registered_device *rdev, if (old == rcu_access_pointer(known->pub.ies)) rcu_assign_pointer(known->pub.ies, new->pub.beacon_ies); - cfg80211_update_hidden_bsses(known, new->pub.beacon_ies, old); + cfg80211_update_hidden_bsses(known, + rcu_access_pointer(new->pub.beacon_ies), + old); if (old) kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);