From patchwork Wed Dec 11 18:39:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luca Coelho X-Patchwork-Id: 3327581 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C39EE9F37A for ; Wed, 11 Dec 2013 18:39:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F13B7207CE for ; Wed, 11 Dec 2013 18:39:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 76C82207CD for ; Wed, 11 Dec 2013 18:39:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374Ab3LKSju (ORCPT ); Wed, 11 Dec 2013 13:39:50 -0500 Received: from emh06.mail.saunalahti.fi ([62.142.5.116]:37136 "EHLO emh06.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989Ab3LKSju (ORCPT ); Wed, 11 Dec 2013 13:39:50 -0500 Received: from porter.P-661HNU-F1 (a88-113-229-85.elisa-laajakaista.fi [88.113.229.85]) by emh06.mail.saunalahti.fi (Postfix) with ESMTP id A3A2369AF7; Wed, 11 Dec 2013 20:39:47 +0200 (EET) From: Luciano Coelho To: linux-wireless@vger.kernel.org, johannes@sipsolutions.net Cc: sw@simonwunderlich.de Subject: [PATCH] mac80211: lock sdata in ieee80211_csa_connection_drop_work() Date: Wed, 11 Dec 2013 20:39:46 +0200 Message-Id: <1386787186-6496-1-git-send-email-luciano.coelho@intel.com> X-Mailer: git-send-email 1.8.5.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We call ieee80211_ibss_disconnect(), which requires sdata to be locked, so lock the sdata during ieee80211_csa_connection_drop_work(). Cc: Simon Wunderlich Signed-off-by: Luciano Coelho --- net/mac80211/ibss.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c index df21e4f..94e5c76 100644 --- a/net/mac80211/ibss.c +++ b/net/mac80211/ibss.c @@ -753,12 +753,16 @@ static void ieee80211_csa_connection_drop_work(struct work_struct *work) container_of(work, struct ieee80211_sub_if_data, u.ibss.csa_connection_drop_work); + sdata_lock(sdata); + ieee80211_ibss_disconnect(sdata); synchronize_rcu(); skb_queue_purge(&sdata->skb_queue); /* trigger a scan to find another IBSS network to join */ ieee80211_queue_work(&sdata->local->hw, &sdata->work); + + sdata_unlock(sdata); } static void ieee80211_ibss_csa_mark_radar(struct ieee80211_sub_if_data *sdata)