]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.25.8/b43-fix-possible-null-pointer-dereference-in-dma-code.patch
Linux 2.6.25.8
[thirdparty/kernel/stable-queue.git] / releases / 2.6.25.8 / b43-fix-possible-null-pointer-dereference-in-dma-code.patch
CommitLineData
cd378b7b
GKH
1From stable-bounces@linux.kernel.org Sat Jun 14 14:46:55 2008
2From: Michael Buesch <mb@bu3sch.de>
3Date: Sat, 14 Jun 2008 22:57:55 +0200
4Subject: b43: Fix possible NULL pointer dereference in DMA code
5To: stable@kernel.org
6Cc: linux-wireless@vger.kernel.org, bcm43xx-dev@lists.berlios.de
7Message-ID: <200806142257.55946.mb@bu3sch.de>
8Content-Disposition: inline
9
10From: Michael Buesch <mb@bu3sch.de>
11
12a cut-down version of commit 028118a5f09a9c807e6b43e2231efdff9f224c74 upstream
13
14This fixes a possible NULL pointer dereference in an error path of the
15DMA allocation error checking code. In case the DMA allocation address is invalid,
16the dev pointer is dereferenced for unmapping of the buffer.
17
18Reported-by: Miles Lane <miles.lane@gmail.com>
19Signed-off-by: Michael Buesch <mb@bu3sch.de>
20Signed-off-by: John W. Linville <linville@tuxdriver.com>
21Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
22
23---
24 drivers/net/wireless/b43/dma.c | 2 +-
25 1 file changed, 1 insertion(+), 1 deletion(-)
26
27--- a/drivers/net/wireless/b43/dma.c
28+++ b/drivers/net/wireless/b43/dma.c
29@@ -850,6 +850,7 @@ struct b43_dmaring *b43_setup_dmaring(st
30 if (!ring)
31 goto out;
32 ring->type = type;
33+ ring->dev = dev;
34
35 nr_slots = B43_RXRING_SLOTS;
36 if (for_tx)
37@@ -901,7 +902,6 @@ struct b43_dmaring *b43_setup_dmaring(st
38 DMA_TO_DEVICE);
39 }
40
41- ring->dev = dev;
42 ring->nr_slots = nr_slots;
43 ring->mmio_base = b43_dmacontroller_base(type, controller_index);
44 ring->index = controller_index;