public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Hinds <dhinds@sonic.net>
To: Thiago Rondon <maluco@mileniumnet.com.br>, dahinds@users.sourceforge.net
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: Re: [PATCH] drivers/pcmcia/cs.c
Date: Wed, 10 Jan 2001 20:05:50 -0800	[thread overview]
Message-ID: <20010110200550.A12593@sonic.net> (raw)
In-Reply-To: <Pine.LNX.4.21.0101101622210.4170-100000@freak.mileniumnet.com.br>
In-Reply-To: <Pine.LNX.4.21.0101101622210.4170-100000@freak.mileniumnet.com.br>; from Thiago Rondon on Wed, Jan 10, 2001 at 04:23:14PM -0200

On Wed, Jan 10, 2001 at 04:23:14PM -0200, Thiago Rondon wrote:
> 
> Check kmalloc().
> 
> -Thiago Rondon
> 
> --- linux-2.4.0-ac5/drivers/pcmcia/cs.c	Fri Dec 29 20:35:47 2000
> +++ linux-2.4.0-ac5.maluco/drivers/pcmcia/cs.c	Wed Jan 10 16:18:11 2001
> @@ -1458,6 +1458,8 @@
>  	    s->functions = 1;
>  	s->config = kmalloc(sizeof(config_t) * s->functions,
>  			    GFP_KERNEL);
> +	if (!s->config) 
> +		return CS_OUT_OF_RESOURCE;
>  	memset(s->config, 0, sizeof(config_t) * s->functions);
>      }

This is not a satisfactory fix; if that kmalloc ever fails, you also
need to back out various things that were done higher up.  You can't
bail out at this spot.

-- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

      reply	other threads:[~2001-01-11  4:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-10 18:23 [PATCH] drivers/pcmcia/cs.c Thiago Rondon
2001-01-11  4:05 ` David Hinds [this message]

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=20010110200550.A12593@sonic.net \
    --to=dhinds@sonic.net \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=dahinds@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maluco@mileniumnet.com.br \
    /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