From patchwork Mon Oct 26 20:38:28 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Buesch X-Patchwork-Id: 55966 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n9QKe611015157 for ; Mon, 26 Oct 2009 20:40:07 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756057AbZJZUjy (ORCPT ); Mon, 26 Oct 2009 16:39:54 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752528AbZJZUjy (ORCPT ); Mon, 26 Oct 2009 16:39:54 -0400 Received: from bu3sch.de ([62.75.166.246]:59561 "EHLO vs166246.vserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755955AbZJZUjx (ORCPT ); Mon, 26 Oct 2009 16:39:53 -0400 Received: by vs166246.vserver.de with esmtpa (Exim 4.69) id 1N2WM9-0008Lt-EU; Mon, 26 Oct 2009 20:39:57 +0000 From: Michael Buesch To: "John W. Linville" Subject: Re: 2.6.32-rc5-git3: Reported regressions from 2.6.31 Date: Mon, 26 Oct 2009 21:38:28 +0100 User-Agent: KMail/1.9.9 Cc: linux-wireless@vger.kernel.org, Christian Casteyde , Johannes Berg References: <200910262011.22950.mb@bu3sch.de> <200910262037.35469.mb@bu3sch.de> In-Reply-To: <200910262037.35469.mb@bu3sch.de> X-Move-Along: Nothing to see here. No, really... Nothing. MIME-Version: 1.0 Content-Disposition: inline Message-Id: <200910262138.30396.mb@bu3sch.de> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org --- wireless-testing.orig/drivers/net/wireless/b43/dma.c +++ wireless-testing/drivers/net/wireless/b43/dma.c @@ -1157,8 +1157,9 @@ struct b43_dmaring *parse_cookie(struct } static int dma_tx_fragment(struct b43_dmaring *ring, - struct sk_buff *skb) + struct sk_buff **in_skb) { + struct sk_buff *skb = *in_skb; const struct b43_dma_ops *ops = ring->ops; struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); u8 *header; @@ -1224,8 +1225,14 @@ static int dma_tx_fragment(struct b43_dm } memcpy(skb_put(bounce_skb, skb->len), skb->data, skb->len); + memcpy(bounce_skb->cb, skb->cb, sizeof(skb->cb)); + bounce_skb->dev = skb->dev; + skb_set_queue_mapping(bounce_skb, skb_get_queue_mapping(skb)); + info = IEEE80211_SKB_CB(bounce_skb); + dev_kfree_skb_any(skb); skb = bounce_skb; + *in_skb = bounce_skb; meta->skb = skb; meta->dmaaddr = map_descbuffer(ring, skb->data, skb->len, 1); if (b43_dma_mapping_error(ring, meta->dmaaddr, skb->len, 1)) { @@ -1355,7 +1362,11 @@ int b43_dma_tx(struct b43_wldev *dev, st * static, so we don't need to store it per frame. */ ring->queue_prio = skb_get_queue_mapping(skb); - err = dma_tx_fragment(ring, skb); + /* dma_tx_fragment might reallocate the skb, so invalidate pointers pointing + * into the skb data or cb now. */ + hdr = NULL; + info = NULL; + err = dma_tx_fragment(ring, &skb); if (unlikely(err == -ENOKEY)) { /* Drop this packet, as we don't have the encryption key * anymore and must not transmit it unencrypted. */