lkml.org 
[lkml]   [2001]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 245-ac4
> 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/

\
 
 \ /
  Last update: 2005-03-22 13:17    [W:0.040 / U:0.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site