]>
Commit | Line | Data |
---|---|---|
cd378b7b GKH |
1 | From stable-bounces@linux.kernel.org Sat Jun 14 14:46:55 2008 |
2 | From: Michael Buesch <mb@bu3sch.de> | |
3 | Date: Sat, 14 Jun 2008 22:57:55 +0200 | |
4 | Subject: b43: Fix possible NULL pointer dereference in DMA code | |
5 | To: stable@kernel.org | |
6 | Cc: linux-wireless@vger.kernel.org, bcm43xx-dev@lists.berlios.de | |
7 | Message-ID: <200806142257.55946.mb@bu3sch.de> | |
8 | Content-Disposition: inline | |
9 | ||
10 | From: Michael Buesch <mb@bu3sch.de> | |
11 | ||
12 | a cut-down version of commit 028118a5f09a9c807e6b43e2231efdff9f224c74 upstream | |
13 | ||
14 | This fixes a possible NULL pointer dereference in an error path of the | |
15 | DMA allocation error checking code. In case the DMA allocation address is invalid, | |
16 | the dev pointer is dereferenced for unmapping of the buffer. | |
17 | ||
18 | Reported-by: Miles Lane <miles.lane@gmail.com> | |
19 | Signed-off-by: Michael Buesch <mb@bu3sch.de> | |
20 | Signed-off-by: John W. Linville <linville@tuxdriver.com> | |
21 | Signed-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; |