Re: [PATCH] slab: Adds missing kmalloc() checks.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 Hi Pekka,

On Sat, 07 Jan 2006 04:12:50 +0200
Pekka Enberg <[email protected]> wrote:

| Hi,
| 
| On Fri, 2006-01-06 at 13:12 -0200, Luiz Fernando Capitulino wrote:
| > | >  Adds two missing kmalloc() checks in kmem_cache_init(). Note that if the
| > | > allocation fails, there is nothing to do, so we panic();
| 
| On Fri, 06 Jan 2006 16:24:47 +0100
| Arjan van de Ven <[email protected]> wrote:
| > | ok so what good does this do? if you die this early.. you are in deeper
| > | problems, and can't boot. while this makes the code bigger...
| 
| On Fri, 2006-01-06 at 13:30 -0200, Luiz Fernando Capitulino wrote:
| >  Well, you'll get a panic with a message saying you have no memory to
| > boot, instead of a OOPS with a kernel NULL pointer derefecence, which
| > will make you look for a bug.
| 
| The code is in init section so I don't think size is an issue. A plain
| BUG_ON would be better though as it can be disabled by the embedded
| folk.

 Okay, but a quick look at the initialization functions called from
'init/main.c' shows that some of them does the same thing (test an
error condition, and panic() if necessary).

 Should they be changed to call BUG_ON() instead?

PS: I'm asking becuase I also found several untested returns, I'll
send patches for they too.

-- 
Luiz Fernando N. Capitulino
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux