Re: [PATCH] tty_io.c: s/suser/capable/, check get_user

From: Linus Torvalds (torvalds@transmeta.com)
Date: Sat Aug 26 2000 - 22:23:30 EST


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/



This archive was generated by hypermail 2b29 : Thu Aug 31 2000 - 21:00:18 EST