From patchwork Tue May 28 05:48:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vasanthakumar Thiagarajan X-Patchwork-Id: 10963715 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E50318EC for ; Tue, 28 May 2019 05:48:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D747286BC for ; Tue, 28 May 2019 05:48:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 02067286BF; Tue, 28 May 2019 05:48:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AEFA4286BC for ; Tue, 28 May 2019 05:48:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:List-Subscribe:List-Help: List-Post:List-Archive:List-Unsubscribe:List-Id:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BbItcd8Y/B9ZMa8VAFvP/lUBABYFcBDIhHzt58FDlUI=; b=MUeWnNEvxJKhuf +25OzbB3vKTJPoY1wO+W36/PMRSxoN+OcqjoMYvTrvYPWGby8hTpx0TbVBGbUOwMnPJssSu6aAn3+ 7B6kEaZL+6D5bc5EpD7JnRwzOWIu8hy7BS0Fb4ioSlalv8U0JfnbGlKXEZrPTB7do92REeyhpYPVO mReGFWRuO+GFxTpdU70J55O/DvUZL5paTRVtjdd5hT8K38l+U3LQS5IdDOk179G4slYASQtbXDELl /cePgKOQiThiYhYah5l1TU6qNdXJIgU5TjaHZgqlEABWYehARXyl2KISds/M6yfKci8zwT/8iCG3j gjcglFUptEWAxCM202fA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVUyN-0007Cf-00; Tue, 28 May 2019 05:48:31 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hVUyK-0007B2-5f for ath11k@lists.infradead.org; Tue, 28 May 2019 05:48:29 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id E0FFC609CD; Tue, 28 May 2019 05:48:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559022507; bh=qyyZWYdgoLNxfwxe4pwjnWZX0GbuJ9JwDJnlxVSoqos=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kRZcoSIxPJzW8K2ee66Un+59ziX/VSgfXBeqTP2EkKBWcJ46vSwJs1JxEtZuLBnxi 8qjjZoZ8kMKrU1wuATjp+QZDUefRMHleWYU/ZsTDM/pQH/C4LBs7EAMdMaklsLba8i eurEnH8wWbYFvakMTM7Rnttz0loKSRtVzj3aXTNo= Received: from vasanth-lnx.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: vthiagar@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id D6A53606FC for ; Tue, 28 May 2019 05:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1559022507; bh=qyyZWYdgoLNxfwxe4pwjnWZX0GbuJ9JwDJnlxVSoqos=; h=From:To:Subject:Date:In-Reply-To:References:From; b=kRZcoSIxPJzW8K2ee66Un+59ziX/VSgfXBeqTP2EkKBWcJ46vSwJs1JxEtZuLBnxi 8qjjZoZ8kMKrU1wuATjp+QZDUefRMHleWYU/ZsTDM/pQH/C4LBs7EAMdMaklsLba8i eurEnH8wWbYFvakMTM7Rnttz0loKSRtVzj3aXTNo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D6A53606FC Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=vthiagar@codeaurora.org From: Vasanthakumar Thiagarajan To: ath11k@lists.infradead.org Subject: [PATCH 3/4] ath11k: Fix bug in accessing rcu protected wiphy->regd Date: Tue, 28 May 2019 11:18:05 +0530 Message-Id: <1559022486-7073-3-git-send-email-vthiagar@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1559022486-7073-1-git-send-email-vthiagar@codeaurora.org> References: <1559022486-7073-1-git-send-email-vthiagar@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190527_224828_224635_4211620F X-CRM114-Status: GOOD ( 10.68 ) X-BeenThere: ath11k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath11k" Errors-To: ath11k-bounces+patchwork-ath11k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Access wiphy->regd through rcu dereference API. This also fixes below sparse warning drivers/net/wireless/ath/ath11k/reg.c:38:39: warning: incorrect type in argument 1 (different address spaces) drivers/net/wireless/ath/ath11k/reg.c:38:39: expected void const * drivers/net/wireless/ath/ath11k/reg.c:38:39: got char const [noderef] * Signed-off-by: Vasanthakumar Thiagarajan --- drivers/net/wireless/ath/ath11k/reg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/ath/ath11k/reg.c b/drivers/net/wireless/ath/ath11k/reg.c index 1fef688..ad87e9d 100644 --- a/drivers/net/wireless/ath/ath11k/reg.c +++ b/drivers/net/wireless/ath/ath11k/reg.c @@ -28,14 +28,17 @@ static bool ath11k_regdom_changes(struct ath11k *ar, char *alpha2) { + const struct ieee80211_regdomain *regd; + + regd = rcu_dereference_rtnl(ar->hw->wiphy->regd); /* This can happen during wiphy registration where the previous * user request is received before we update the regd received * from firmware. */ - if (!ar->hw->wiphy->regd) + if (!regd) return true; - return !!(memcmp(ar->hw->wiphy->regd->alpha2, alpha2, 2)); + return !!(memcmp(regd->alpha2, alpha2, 2)); } static void