Re: [PATCH] 245-ac4
Mikulas Patocka (mikulas@artax.karlin.mff.cuni.cz)
Wed, 30 May 2001 20:34:45 +0200 (CEST)
> Hi all,
>
> This patch remove some NULL parameters tests in kfree-like functions and
> add this directly in function.
>
> - dev_kfree_skb_irq == dev_kfree_skb == kfree_skb
> - kfree already handle null parameters :
> void kfree (const void *objp)
> {
> kmem_cache_t *c;
> unsigned long flags;
>
> >> if (!objp)
> >> return;
>
> local_irq_save(flags);
> CHECK_PAGE(virt_to_page(objp));
> c = GET_PAGE_CACHE(virt_to_page(objp));
> __kmem_cache_free(c, (void*)objp);
> local_irq_restore(flags);
> }
This is bad. It will only slow thing down.
It will also hide allocation errors in the rest of the kernel. A bug that
causes crash is much better than the one that doesn't.
Mikulas
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/