Re: [PATCH] slub: avoid potential NULL dereference or corruption

From: Christoph Lameter
Date: Tue Nov 22 2011 - 09:57:04 EST


On Tue, 22 Nov 2011, Eric Dumazet wrote:

> diff --git a/mm/slub.c b/mm/slub.c
> index 7d2a996..e8e6714 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -4436,29 +4436,33 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
> for_each_possible_cpu(cpu) {
> struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu);
> struct page *page;
> + int node;
>
> - if (!c || c->node < 0)
> + if (!c)
> continue;

Drop the check. c can never be NULL these days.

Otherwiswe it looks okay.

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