public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ipw2200: Missing kmalloc check
@ 2005-09-05  2:14 Panagiotis Issaris
  2005-09-05 11:53 ` Jiri Slaby
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Panagiotis Issaris @ 2005-09-05  2:14 UTC (permalink / raw)
  To: ipw2100-admin; +Cc: linux-kernel


The ipw2200 driver code in current GIT contains a kmalloc() followed by
a memset() without handling a possible memory allocation failure.

Signed-off-by: Panagiotis Issaris <panagiotis.issaris@gmail.com>
---

 drivers/net/wireless/ipw2200.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

8e288419b49346fee512739acac446c951727d04
diff --git a/drivers/net/wireless/ipw2200.c
b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -3976,6 +3976,10 @@ static struct ipw_rx_queue *ipw_rx_queue
 	int i;
 
 	rxq = (struct ipw_rx_queue *)kmalloc(sizeof(*rxq), GFP_KERNEL);
+	if (unlikely(!rxq)) {
+		IPW_ERROR("memory allocation failed\n");
+		return NULL;
+	}
 	memset(rxq, 0, sizeof(*rxq));
 	spin_lock_init(&rxq->lock);
 	INIT_LIST_HEAD(&rxq->rx_free);



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-11-07 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-05  2:14 [PATCH] ipw2200: Missing kmalloc check Panagiotis Issaris
2005-09-05 11:53 ` Jiri Slaby
2005-09-05 14:26   ` Takis
2005-10-28 20:57 ` Jeff Garzik
2005-11-07 18:32 ` Rolf Eike Beer
2005-11-07 20:35   ` Takis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox