From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Emmanuel Grumbach" , "Johannes Berg" Date: Mon, 28 Apr 2014 02:11:22 +0100 Message-ID: Subject: [PATCH 3.2 45/94] iwlwifi: dvm: take mutex when sending SYNC BT config command In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-ID: 3.2.58-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Emmanuel Grumbach commit 82e5a649453a3cf23516277abb84273768a1592b upstream. There is a flow in which we send the host command in SYNC mode, but we don't take priv->mutex. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1046495 Reviewed-by: Johannes Berg Signed-off-by: Emmanuel Grumbach [bwh: Backported to 3.2: - Adjust filename, context - mutex is priv->shrd->mutex] Signed-off-by: Ben Hutchings --- drivers/net/wireless/iwlwifi/iwl-agn.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c @@ -246,13 +246,17 @@ static void iwl_bg_bt_runtime_config(str struct iwl_priv *priv = container_of(work, struct iwl_priv, bt_runtime_config); + mutex_lock(&priv->shrd->mutex); if (test_bit(STATUS_EXIT_PENDING, &priv->shrd->status)) - return; + goto out; /* dont send host command if rf-kill is on */ if (!iwl_is_ready_rf(priv->shrd)) - return; + goto out; + iwlagn_send_advance_bt_config(priv); +out: + mutex_unlock(&priv->shrd->mutex); } static void iwl_bg_bt_full_concurrency(struct work_struct *work)