From patchwork Thu Nov 21 15:56:23 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Wunderlich X-Patchwork-Id: 3219821 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0631EC045B for ; Thu, 21 Nov 2013 15:56:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B583C20752 for ; Thu, 21 Nov 2013 15:56:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB3FF206CE for ; Thu, 21 Nov 2013 15:56:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754267Ab3KUP4d (ORCPT ); Thu, 21 Nov 2013 10:56:33 -0500 Received: from packetmixer.de ([79.140.42.25]:55930 "EHLO mail.mail.packetmixer.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751226Ab3KUP4b (ORCPT ); Thu, 21 Nov 2013 10:56:31 -0500 Received: from kero.packetmixer.de (drsd-4dbdbb45.pool.mediaWays.net [77.189.187.69]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.mail.packetmixer.de (Postfix) with ESMTPSA id 3D29462403; Thu, 21 Nov 2013 16:08:30 +0000 (UTC) From: Simon Wunderlich To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Simon Wunderlich Subject: [PATCH 4/4] mac80211: don't leak next beacon when csa is aborted Date: Thu, 21 Nov 2013 16:56:23 +0100 Message-Id: <1385049383-5617-5-git-send-email-sw@simonwunderlich.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1385049383-5617-1-git-send-email-sw@simonwunderlich.de> References: <1385049383-5617-1-git-send-email-sw@simonwunderlich.de> 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.4 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 Signed-off-by: Simon Wunderlich --- net/mac80211/cfg.c | 5 +++++ net/mac80211/iface.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 9f19cde..8bf0cc0 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -1079,7 +1079,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev) old_probe_resp = sdata_dereference(sdata->u.ap.probe_resp, sdata); /* abort any running channel switch */ + if (sdata->vif.csa_active) { + kfree(sdata->u.ap.next_beacon); + sdata->u.ap.next_beacon = NULL; + } sdata->vif.csa_active = false; + cancel_work_sync(&sdata->u.ap.request_smps_work); /* turn off carrier for this interface and dependent VLANs */ diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index d226751..dce4398 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -820,8 +820,13 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, cancel_work_sync(&local->dynamic_ps_enable_work); cancel_work_sync(&sdata->recalc_smps); - sdata->vif.csa_active = false; cancel_work_sync(&sdata->csa_finalize_work); + /* free left-over next beacon if a CSA was aborted */ + if (sdata->vif.csa_active && sdata->vif.type == NL80211_IFTYPE_AP) { + kfree(sdata->u.ap.next_beacon); + sdata->u.ap.next_beacon = NULL; + } + sdata->vif.csa_active = false; cancel_delayed_work_sync(&sdata->dfs_cac_timer_work);