Skip to content

Commit

Permalink
[PATCH] bcm43xx: Fix crash on ifdown, by being careful in pio/dma fre…
Browse files Browse the repository at this point in the history
…eing.

This bug was caused by the packing of the bcm43xx_dma and bcm43xx_pio
structures into a union.

Signed-off-by: Michael Buesch <mbuesch@freenet.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
  • Loading branch information
Michael Buesch authored and John W. Linville committed Mar 27, 2006
1 parent e9357c0 commit 49f29ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion drivers/net/wireless/bcm43xx/bcm43xx_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,11 @@ static void bcm43xx_destroy_dmaring(struct bcm43xx_dmaring *ring)

void bcm43xx_dma_free(struct bcm43xx_private *bcm)
{
struct bcm43xx_dma *dma = bcm43xx_current_dma(bcm);
struct bcm43xx_dma *dma;

if (bcm43xx_using_pio(bcm))
return;
dma = bcm43xx_current_dma(bcm);

bcm43xx_destroy_dmaring(dma->rx_ring1);
dma->rx_ring1 = NULL;
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/bcm43xx/bcm43xx_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ static void bcm43xx_destroy_pioqueue(struct bcm43xx_pioqueue *queue)

void bcm43xx_pio_free(struct bcm43xx_private *bcm)
{
struct bcm43xx_pio *pio = bcm43xx_current_pio(bcm);
struct bcm43xx_pio *pio;

if (!bcm43xx_using_pio(bcm))
return;
pio = bcm43xx_current_pio(bcm);

bcm43xx_destroy_pioqueue(pio->queue3);
pio->queue3 = NULL;
Expand Down

0 comments on commit 49f29ef

Please sign in to comment.