From patchwork Wed Feb 13 12:51:19 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: michael-dev X-Patchwork-Id: 2137211 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9685CDFE75 for ; Wed, 13 Feb 2013 14:50:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934089Ab3BMOur (ORCPT ); Wed, 13 Feb 2013 09:50:47 -0500 Received: from gast-001.fem.tu-ilmenau.de ([141.24.44.1]:60162 "EHLO a251.fem.tu-ilmenau.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759204Ab3BMOuq (ORCPT ); Wed, 13 Feb 2013 09:50:46 -0500 Received: by konsullaptop.a-keller (Postfix, from userid 1000) id 62E9A222E81; Wed, 13 Feb 2013 13:51:23 +0100 (CET) From: Michael Braun To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, projekt-wlan@fem.tu-ilmenau.de, Michael Braun Subject: [RFCv5 1/2] mac80211: free ps->bc_buf skbs on vlan device stop Date: Wed, 13 Feb 2013 13:51:19 +0100 Message-Id: <1360759880-5669-2-git-send-email-michael-dev@fami-braun.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360759880-5669-1-git-send-email-michael-dev@fami-braun.de> References: <1360759880-5669-1-git-send-email-michael-dev@fami-braun.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org When the vlan device is removed, ps->bc_buf processing can no longer send its frames. Signed-off-by: Michael Braun --- V4: Add this patch. V5: add spin_lock, switch order of patches net/mac80211/iface.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 40ff030..bb1cdc6 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -680,6 +680,7 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb, *tmp; u32 hw_reconf_flags = 0; int i, flushed; + struct ps_data *ps; clear_bit(SDATA_STATE_RUNNING, &sdata->state); @@ -758,6 +759,19 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, u.vlan.list) dev_close(vlan->dev); WARN_ON(!list_empty(&sdata->u.ap.vlans)); + } else if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { + /* remove all packets in parent bc_buf pointing to this dev */ + ps = &sdata->bss->ps; + + spin_lock_irqsave(&ps->bc_buf.lock, flags); + skb_queue_walk_safe(&ps->bc_buf, skb, tmp) { + if (skb->dev == sdata->dev) { + __skb_unlink(skb, &ps->bc_buf); + local->total_ps_buffered--; + kfree_skb(skb); + } + } + spin_unlock_irqrestore(&ps->bc_buf.lock, flags); } else if (sdata->vif.type == NL80211_IFTYPE_STATION) { ieee80211_mgd_stop(sdata); }