[patch 15/47] b43legacy: Fix possible NULL pointer dereference in DMA code

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Tuesday, July 22, 2008 - 4:15 pm

2.6.25-stable review patch.  If anyone has any objections, please let us
know.

------------------
From: Michael Buesch <mb@bu3sch.de>

commit 2f9ec47d0954f9d2e5a00209c2689cbc477a8c89 upstream

This fixes a possible NULL pointer dereference in an error path of the
DMA allocation error checking code. This is also necessary for a future
DMA API change that is on its way into the mainline kernel that adds
an additional dev parameter to dma_mapping_error().

Signed-off-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/net/wireless/b43legacy/dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -876,6 +876,7 @@ struct b43legacy_dmaring *b43legacy_setu
 	if (!ring)
 		goto out;
 	ring->type = type;
+	ring->dev = dev;
 
 	nr_slots = B43legacy_RXRING_SLOTS;
 	if (for_tx)
@@ -922,7 +923,6 @@ struct b43legacy_dmaring *b43legacy_setu
 				 DMA_TO_DEVICE);
 	}
 
-	ring->dev = dev;
 	ring->nr_slots = nr_slots;
 	ring->mmio_base = b43legacy_dmacontroller_base(type, controller_index);
 	ring->index = controller_index;

-- 
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/47] 2.6.25-stable review, Greg KH, (Tue Jul 22, 4:13 pm)
[patch 04/47] mac80211: detect driver tx bugs, Greg KH, (Tue Jul 22, 4:14 pm)
[patch 11/47] USB: ehci - fix timer regression, Greg KH, (Tue Jul 22, 4:14 pm)
[patch 15/47] b43legacy: Fix possible NULL pointer derefer ..., Greg KH, (Tue Jul 22, 4:15 pm)
[patch 19/47] SCSI: ses: Fix timeout, Greg KH, (Tue Jul 22, 4:15 pm)
[patch 24/47] can: add sanity checks, Greg KH, (Tue Jul 22, 4:16 pm)
[patch 25/47] sisusbvga: Fix oops on disconnect., Greg KH, (Tue Jul 22, 4:16 pm)
[patch 34/47] tpm: add Intel TPM TIS device HID, Greg KH, (Tue Jul 22, 4:16 pm)
Re: [patch 00/47] 2.6.25-stable review, Michael Krufky, (Tue Jul 22, 9:42 pm)
Re: [patch 00/47] 2.6.25-stable review, Michael Krufky, (Tue Jul 22, 9:51 pm)
Re: [patch 44/47] pxamci: fix byte aligned DMA transfers, pHilipp Zabel, (Wed Jul 23, 12:01 am)