Re: [PATCH] Trivial patch against mempool

From: Benjamin LaHaise (bcrl@redhat.com)
Date: Fri Feb 22 2002 - 19:02:56 EST


On Fri, Feb 22, 2002 at 12:28:14PM -0800, Balbir Singh wrote:
> Check if the alloc_fn and free_fn are not NULL. The caller generally
> ensures that alloc_fn and free_fn are valid. It would not harm
> to check. This makes the checking in mempool_create() more complete.

Rather than leak memory in that case, why not just BUG_ON null
function pointers so that people know what code is at fault?

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



This archive was generated by hypermail 2b29 : Sat Feb 23 2002 - 21:00:47 EST