From: Rasmus Andersen <rasmus@jaquet.dk>
To: Arnaldo Carvalho de Melo <acme@conectiva.com.br>,
Eric Lammerts <eric@lammerts.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16)
Date: Sun, 24 Jun 2001 21:46:35 +0200 [thread overview]
Message-ID: <20010624214635.C847@jaquet.dk> (raw)
In-Reply-To: <20010623152202.B840@jaquet.dk> <Pine.LNX.4.33.0106231901560.7165-100000@ally.lammerts.org> <20010623143006.A7004@conectiva.com.br>
In-Reply-To: <20010623143006.A7004@conectiva.com.br>; from acme@conectiva.com.br on Sat, Jun 23, 2001 at 02:30:06PM -0300
On Sat, Jun 23, 2001 at 02:30:06PM -0300, Arnaldo Carvalho de Melo wrote:
[...]
> printk(KERN_ERR __FUNCTION__ "Out of memory.");
>
> Then if you move the code to other function or if you change the name of
> the function you don't have to go all over the code doing
> s/old_function_name/new_function_name/g
Excellent suggestion. How about this one:
--- linux-245-ac16-clean/drivers/pcmcia/rsrc_mgr.c Sat May 19 20:59:21 2001+++ linux-245-ac16/drivers/pcmcia/rsrc_mgr.c Sat Jun 23 15:06:54 2001
@@ -189,6 +189,11 @@
/* First, what does a floating port look like? */
b = kmalloc(256, GFP_KERNEL);
+ if (!b) {
+ printk(" -- aborting.\n");
+ printk(KERN_ERR __FUNCTION__ ": Out of memory.");
+ return;
+ }
memset(b, 0, 256);
for (i = base, most = 0; i < base+num; i += 8) {
if (check_io_resource(i, 8))
--
Regards,
Rasmus(rasmus@jaquet.dk)
You don't become a failure until you're satisfied with being one.
-- Anonymous
next prev parent reply other threads:[~2001-06-24 19:47 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-06-23 13:22 [PATCH] add kmalloc check in drviers/pcmcia/rsrc_mgr.c (245-ac16) Rasmus Andersen
2001-06-23 17:09 ` Eric Lammerts
2001-06-23 17:30 ` Arnaldo Carvalho de Melo
2001-06-24 19:46 ` Rasmus Andersen [this message]
2001-06-24 20:52 ` Eric Lammerts
2001-06-24 21:01 ` Rasmus Andersen
2001-06-24 21:09 ` Eric Lammerts
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=20010624214635.C847@jaquet.dk \
--to=rasmus@jaquet.dk \
--cc=acme@conectiva.com.br \
--cc=eric@lammerts.org \
--cc=linux-kernel@vger.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