lkml.org 
[lkml]   [2000]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] tty_io.c: s/suser/capable/, check get_user


On Sat, 26 Aug 2000, Arnaldo Carvalho de Melo wrote:
>
> Please consider applying. Also an RFC: is it ok to do a kfree
> without checking if it is NULL in case of error handling? By looking
> at the code it is safe and becomes mostly a no op, but it is ok to
> do it this way?

It should be ok - if kfree() has problems with a NULL pointer that is a
bug in kfree. Basically, I'd like the kernel kmalloc/kfree to look as much
as possible as the user ones (apart, obviously, from the kernel-forced
stuff like the memory allocation attribute). And malloc/free allow NULL
pointers - it would be a nasty surprise to people who are used to that if
the kmalloc/kfree thing behaved differently.

Linus

-
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/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.099 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site