All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: Panagiotis Issaris <panagiotis.issaris@gmail.com>
Cc: ipw2100-admin@linux.intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipw2200: Missing kmalloc check
Date: Mon, 05 Sep 2005 13:53:09 +0200	[thread overview]
Message-ID: <431C31A5.3080804@gmail.com> (raw)
In-Reply-To: <1125886450.4017.14.camel@nyx>

Panagiotis Issaris napsal(a):

>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));
>  
>
and use kzalloc instead of kmalloc and memset 0?

> 	spin_lock_init(&rxq->lock);
> 	INIT_LIST_HEAD(&rxq->rx_free);
>  
>
-- 
Jiri Slaby         www.fi.muni.cz/~xslaby
~\-/~      jirislaby@gmail.com      ~\-/~
241B347EC88228DE51EE A49C4A73A25004CB2A10


  reply	other threads:[~2005-09-05 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-05  2:14 [PATCH] ipw2200: Missing kmalloc check Panagiotis Issaris
2005-09-05 11:53 ` Jiri Slaby [this message]
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

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=431C31A5.3080804@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=ipw2100-admin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=panagiotis.issaris@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.