From: Michael Buesch <mb@bu3sch.de>
To: stable@kernel.org
Cc: John Linville <linville@tuxdriver.com>,
bcm43xx-dev@lists.berlios.de, linux-wireless@vger.kernel.org
Subject: [PATCH stable] b43legacy: Fix possible NULL pointer dereference in DMA code
Date: Fri, 20 Jun 2008 11:46:12 +0200 [thread overview]
Message-ID: <200806201146.12984.mb@bu3sch.de> (raw)
This fixes a possible NULL pointer dereference in an error path of the
DMA allocation error checking code.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
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
next reply other threads:[~2008-06-20 9:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-20 9:46 Michael Buesch [this message]
2008-06-22 16:59 ` [stable] [PATCH stable] b43legacy: Fix possible NULL pointer dereference in DMA code Greg KH
2008-06-22 17:23 ` Michael Buesch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200806201146.12984.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=bcm43xx-dev@lists.berlios.de \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=stable@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).