Search Linux Wireless

[PATCH stable] b43legacy: Fix possible NULL pointer dereference in DMA code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fixes a possible NULL pointer dereference in an error path of the
DMA allocation error checking code.

Signed-off-by: Michael Buesch <mb@xxxxxxxxx>

---

This patch is not merged to an upstream tree, yet, but is sent to John.


Index: linux-2.6.25.6/drivers/net/wireless/b43legacy/dma.c
===================================================================
--- linux-2.6.25.6.orig/drivers/net/wireless/b43legacy/dma.c	2008-06-14 22:41:44.000000000 +0200
+++ linux-2.6.25.6/drivers/net/wireless/b43legacy/dma.c	2008-06-20 11:42:20.000000000 +0200
@@ -873,12 +873,13 @@ struct b43legacy_dmaring *b43legacy_setu
 	dma_addr_t dma_test;
 
 	ring = kzalloc(sizeof(*ring), GFP_KERNEL);
 	if (!ring)
 		goto out;
 	ring->type = type;
+	ring->dev = dev;
 
 	nr_slots = B43legacy_RXRING_SLOTS;
 	if (for_tx)
 		nr_slots = B43legacy_TXRING_SLOTS;
 
 	ring->meta = kcalloc(nr_slots, sizeof(struct b43legacy_dmadesc_meta),
@@ -919,13 +920,12 @@ struct b43legacy_dmaring *b43legacy_setu
 
 		dma_unmap_single(dev->dev->dma_dev,
 				 dma_test, sizeof(struct b43legacy_txhdr_fw3),
 				 DMA_TO_DEVICE);
 	}
 
-	ring->dev = dev;
 	ring->nr_slots = nr_slots;
 	ring->mmio_base = b43legacy_dmacontroller_base(type, controller_index);
 	ring->index = controller_index;
 	if (type == B43legacy_DMA_64BIT)
 		ring->ops = &dma64_ops;
 	else
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux