diff options
author | Michael Buesch <mbuesch@freenet.de> | 2006-03-14 10:05:26 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2006-03-27 11:19:38 -0500 |
commit | 49f29efa7f44a79b64c7882c68e171898d0495a0 (patch) | |
tree | c09f7a2be4a1eaa4a9d7ab2c095633c9003dc905 /drivers | |
parent | e9357c056c5e62516f0044e60591d41f00ca7cfa (diff) |
[PATCH] bcm43xx: Fix crash on ifdown, by being careful in pio/dma freeing.
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_dma.c | 6 | ||||
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_pio.c | 6 |
2 files changed, 10 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c index 7ed368a587f3..9c64438b767f 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_dma.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_dma.c | |||
@@ -531,7 +531,11 @@ static void bcm43xx_destroy_dmaring(struct bcm43xx_dmaring *ring) | |||
531 | 531 | ||
532 | void bcm43xx_dma_free(struct bcm43xx_private *bcm) | 532 | void bcm43xx_dma_free(struct bcm43xx_private *bcm) |
533 | { | 533 | { |
534 | struct bcm43xx_dma *dma = bcm43xx_current_dma(bcm); | 534 | struct bcm43xx_dma *dma; |
535 | |||
536 | if (bcm43xx_using_pio(bcm)) | ||
537 | return; | ||
538 | dma = bcm43xx_current_dma(bcm); | ||
535 | 539 | ||
536 | bcm43xx_destroy_dmaring(dma->rx_ring1); | 540 | bcm43xx_destroy_dmaring(dma->rx_ring1); |
537 | dma->rx_ring1 = NULL; | 541 | dma->rx_ring1 = NULL; |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c index 7bddae910de9..5b6f0a84d017 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_pio.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_pio.c | |||
@@ -377,7 +377,11 @@ static void bcm43xx_destroy_pioqueue(struct bcm43xx_pioqueue *queue) | |||
377 | 377 | ||
378 | void bcm43xx_pio_free(struct bcm43xx_private *bcm) | 378 | void bcm43xx_pio_free(struct bcm43xx_private *bcm) |
379 | { | 379 | { |
380 | struct bcm43xx_pio *pio = bcm43xx_current_pio(bcm); | 380 | struct bcm43xx_pio *pio; |
381 | |||
382 | if (!bcm43xx_using_pio(bcm)) | ||
383 | return; | ||
384 | pio = bcm43xx_current_pio(bcm); | ||
381 | 385 | ||
382 | bcm43xx_destroy_pioqueue(pio->queue3); | 386 | bcm43xx_destroy_pioqueue(pio->queue3); |
383 | pio->queue3 = NULL; | 387 | pio->queue3 = NULL; |