Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934733AbcCIXu5 (ORCPT ); Wed, 9 Mar 2016 18:50:57 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:40573 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934494AbcCIXPc (ORCPT ); Wed, 9 Mar 2016 18:15:32 -0500 From: Kamal Mostafa To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Cc: Eliad Peller , Johannes Berg , Kamal Mostafa Subject: [PATCH 3.13.y-ckt 013/138] mac80211: start_next_roc only if scan was actually running Date: Wed, 9 Mar 2016 15:12:20 -0800 Message-Id: <1457565265-15195-14-git-send-email-kamal@canonical.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1457565265-15195-1-git-send-email-kamal@canonical.com> References: <1457565265-15195-1-git-send-email-kamal@canonical.com> X-Extended-Stable: 3.13 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2389 Lines: 65 3.13.11-ckt36 -stable review patch. If anyone has any objections, please let me know. ---8<------------------------------------------------------------ From: Eliad Peller commit a2b70e833e189a4aefb2d3b668e3d7046dcc45c2 upstream. On scan completion we try start any pending roc. However, if scan was just pending (and not actually started) there is no point in trying to start the roc, as it might have started already. This solves the following warning: WARNING: CPU: 0 PID: 3552 at net/mac80211/offchannel.c:269 ieee80211_start_next_roc+0x164/0x204 [mac80211]() [] (unwind_backtrace+0x0/0xf0) [] (show_stack+0x10/0x14) [] (dump_stack+0x78/0x94) [] (warn_slowpath_common+0x68/0x8c) [] (warn_slowpath_null+0x1c/0x24) [] (ieee80211_start_next_roc+0x164/0x204 [mac80211]) [] (ieee80211_scan_cancel+0xe8/0x190 [mac80211]) [] (ieee80211_do_stop+0x63c/0x79c [mac80211]) [] (ieee80211_stop+0x10/0x18 [mac80211]) [] (__dev_close_many+0x84/0xcc) [] (__dev_close+0x28/0x3c) [] (__dev_change_flags+0x78/0x144) [] (dev_change_flags+0x10/0x48) [] (devinet_ioctl+0x614/0x6d0) [] (sock_ioctl+0x5c/0x2a4) [] (do_vfs_ioctl+0x7c/0x5d8) [] (SyS_ioctl+0x6c/0x7c) Signed-off-by: Eliad Peller Signed-off-by: Johannes Berg Signed-off-by: Kamal Mostafa --- net/mac80211/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/mac80211/scan.c b/net/mac80211/scan.c index bcc4833..03a7f36 100644 --- a/net/mac80211/scan.c +++ b/net/mac80211/scan.c @@ -275,6 +275,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, bool was_hw_scan) { struct ieee80211_local *local = hw_to_local(hw); + bool was_scanning = local->scanning; lockdep_assert_held(&local->mtx); @@ -327,7 +328,8 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, ieee80211_mlme_notify_scan_completed(local); ieee80211_ibss_notify_scan_completed(local); ieee80211_mesh_notify_scan_completed(local); - ieee80211_start_next_roc(local); + if (was_scanning) + ieee80211_start_next_roc(local); } void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted) -- 2.7.0