Re: [PATCH] nommu: fix kobjsize() for SLOB and SLUB, v2.

From: Vegard Nossum
Date: Tue Jun 10 2008 - 14:18:57 EST


On 6/10/08, Christoph Lameter <clameter@xxxxxxx> wrote:
> On Mon, 2 Jun 2008, Paul Mundt wrote:
>
> > + page = virt_to_head_page(objp);
> > + if (!page)
> > + return 0;
>
>
> virt_to_head_page cannot return NULL. virt_to_page also does not return
> NULL. pfn_valid() needs to be used to figure out if a page is valid.
> Otherwise the page struct reference that was returned may have
> PageReserved() set to indicate that it is not a valid page.
>

Are you sure it shouldn't be virt_addr_valid()? If yes, can you please
explain the difference? Thanks :-)


Vegard

--
"The animistic metaphor of the bug that maliciously sneaked in while
the programmer was not looking is intellectually dishonest as it
disguises that the error is the programmer's own creation."
-- E. W. Dijkstra, EWD1036
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/