Re: [PATCH] Fix sys_mount not to free_page(0)

Linus Torvalds (torvalds@transmeta.com)
Fri, 6 Aug 1999 17:00:58 -0700 (PDT)


On Fri, 6 Aug 1999, Kanoj Sarcar wrote:
> >
> > free_page(0) is actually supposed to work. Doesn't it?
>
> Umm, it does ... I was thinking it was happenstance, and not by design.

It's by design - I am of the religion that thinks that

free(malloc());

is always legal, even when the malloc() fails.

> Is it worthwhile to clean this up, or do other places in the code rely
> on this behavior of free_page?

There might be any number of places who just free a page, it doesn't even
slow down free_page(), because the 0 case just falls out quite naturally
from having to test for out-of-range and reserved pages anyway.

Linus

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