From patchwork Fri Oct 5 13:55:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 10628205 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 463F9112B for ; Fri, 5 Oct 2018 13:56:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 36F79292FD for ; Fri, 5 Oct 2018 13:56:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A85C2931F; Fri, 5 Oct 2018 13:56:05 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D4E84292FD for ; Fri, 5 Oct 2018 13:56:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728751AbeJEUys (ORCPT ); Fri, 5 Oct 2018 16:54:48 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46040 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728407AbeJEUys (ORCPT ); Fri, 5 Oct 2018 16:54:48 -0400 Received: by mail-pg1-f193.google.com with SMTP id t70-v6so4766074pgd.12; Fri, 05 Oct 2018 06:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=ZJ3IGXH0brX7jc6O3u+EPbBsEwSKUB3OqsRntJHEE74=; b=N1vak8b5D47HTrlkt/KJpO43Vz1Fz3JASn6Va4wGY1zIjtNPEfLgIP7wL1nPxYuP2v unkNOb+GWmbMMc41hTnUr+RysQw+bLCYO0zklHOznb9DarKYG+yMnkr+ZwVDnmYFj8Pu 4UU+okgNKL3TZ79Yr3yDCqTKHECyK6r12bzSxX+hwZ53AG8t3uUFFB727tCW9XFNhC+3 60KgQN556XshhiSVNHwd2omPafCRQLFrGznvdpZlvtnXCKwdhMxWXvxXBjY+Fmya968r My1ghL5MBbcmPaxAofY7rHUtH/0bkK0wkBmwpZCSEVvZ9j/HHSHJf9ijjMkBa7WpV2+D 7D3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=ZJ3IGXH0brX7jc6O3u+EPbBsEwSKUB3OqsRntJHEE74=; b=JmNlChWZf4tq11HI8qsbAtcOpa8cJukW63BhwuSP2gZse1KDwNVB8ME85YK8Ls65+u Ut5KMtsa1f9alYvKtZlLCzi0C6NSv8eulZud5J7NhWQR3CCb0yJA5TeU2y2WgZ5ysQ29 atbWvOqvcJEq0FrgBRIrLdBCWdHnPHN0BRI2tgsW4kadUU+ZTzpluj+lLmwhyOE00ITw ihQvovAy42QNoEhlXUZKCHHxsVHHfj3rTqDr/xz07VBex18htes8tRHZ9EsrOh66qZxo 23Ugkp0/IQwY7I5MccTwuG24oibXgSAMDh6guqFjo8icAnlh1tzsGcaErPGZreDbLwM0 DaHQ== X-Gm-Message-State: ABuFfoipUQzAA+I020JUVgMukEvPvDkgSCHmSDETJXzEu8KBLzFGSLMf BHlO8Ia7gpTAF2QgJd9K3+A= X-Google-Smtp-Source: ACcGV61uvxfx8GIZNUS9WXq1cgKf7kUDaTQiExB3A3EuvlhQJScRE/JNwhA2M57q5Y5RYFSrFplLeQ== X-Received: by 2002:a62:830e:: with SMTP id h14-v6mr12329045pfe.29.1538747757146; Fri, 05 Oct 2018 06:55:57 -0700 (PDT) Received: from localhost.localdomain ([2402:f000:1:4414:51be:f9f2:35c8:7b56]) by smtp.gmail.com with ESMTPSA id r73-v6sm17988049pfk.157.2018.10.05.06.55.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 05 Oct 2018 06:55:56 -0700 (PDT) From: Jia-Ju Bai To: sgruszka@redhat.com, kvalo@codeaurora.org, davem@davemloft.net Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] net: wireless: iwlegacy: Add a lock assertion in il4965_send_rxon_assoc() Date: Fri, 5 Oct 2018 21:55:46 +0800 Message-Id: <20181005135546.21011-1-baijiaju1990@gmail.com> X-Mailer: git-send-email 2.17.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The variables il->staging.filter_flags, rxon1->filter_flags and rxon2->filter_flags need to be protected by the mutex lock il->mutex. This patch adds a lock assertion of il->mutex to check whether this lock is held. Signed-off-by: Jia-Ju Bai Acked-by: Stanislaw Gruszka --- drivers/net/wireless/intel/iwlegacy/4965.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/intel/iwlegacy/4965.c b/drivers/net/wireless/intel/iwlegacy/4965.c index c3c638ed0ed7..ce4144a89217 100644 --- a/drivers/net/wireless/intel/iwlegacy/4965.c +++ b/drivers/net/wireless/intel/iwlegacy/4965.c @@ -1297,6 +1297,8 @@ il4965_send_rxon_assoc(struct il_priv *il) const struct il_rxon_cmd *rxon1 = &il->staging; const struct il_rxon_cmd *rxon2 = &il->active; + lockdep_assert_held(&il->mutex); + if (rxon1->flags == rxon2->flags && rxon1->filter_flags == rxon2->filter_flags && rxon1->cck_basic_rates == rxon2->cck_basic_rates &&