]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
b43: allocate receive buffers big enough for max frame len + offset
authorJohn W. Linville <linville@tuxdriver.com>
Wed, 30 Mar 2011 18:02:46 +0000 (14:02 -0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 14 Apr 2011 23:53:31 +0000 (16:53 -0700)
commit c85ce65ecac078ab1a1835c87c4a6319cf74660a upstream.

Otherwise, skb_put inside of dma_rx can fail...

https://bugzilla.kernel.org/show_bug.cgi?id=32042

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/wireless/b43/dma.c
drivers/net/wireless/b43/dma.h

index 571d475ca321684af1bbd6084ea264dc3233b824..8bf4bbdfaec64fae50f4d658ed7a03774c45328a 100644 (file)
@@ -1521,7 +1521,7 @@ static void dma_rx(struct b43_dmaring *ring, int *slot)
                dmaaddr = meta->dmaaddr;
                goto drop_recycle_buffer;
        }
-       if (unlikely(len > ring->rx_buffersize)) {
+       if (unlikely(len + ring->frameoffset > ring->rx_buffersize)) {
                /* The data did not fit into one descriptor buffer
                 * and is split over multiple buffers.
                 * This should never happen, as we try to allocate buffers
index f0b0838fb5baa504a0d41b1793aa7dd61f189e36..ceee7a3dabc141203c5c5ec60892c5cd004f99fb 100644 (file)
@@ -163,7 +163,7 @@ struct b43_dmadesc_generic {
 /* DMA engine tuning knobs */
 #define B43_TXRING_SLOTS               256
 #define B43_RXRING_SLOTS               64
-#define B43_DMA0_RX_BUFFERSIZE         IEEE80211_MAX_FRAME_LEN
+#define B43_DMA0_RX_BUFFERSIZE         (B43_DMA0_RX_FRAMEOFFSET + IEEE80211_MAX_FRAME_LEN)
 
 
 struct sk_buff;