public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rolf Eike Beer <eike-kernel@sf-tec.de>
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, 7 Nov 2005 19:32:15 +0100	[thread overview]
Message-ID: <200511071932.22060@bilbo.math.uni-mannheim.de> (raw)
In-Reply-To: <1125886450.4017.14.camel@nyx>

[-- Attachment #1: Type: text/plain, Size: 921 bytes --]

Panagiotis Issaris wrote:
>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));

Please remove the cast and use kzalloc() instead of kmalloc() and 
memset(,0,).

Eike

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  parent reply	other threads:[~2005-11-07 18:32 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
2005-09-05 14:26   ` Takis
2005-10-28 20:57 ` Jeff Garzik
2005-11-07 18:32 ` Rolf Eike Beer [this message]
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=200511071932.22060@bilbo.math.uni-mannheim.de \
    --to=eike-kernel@sf-tec.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox