Re: [PATCH] include/linux/slab.h: new KFREE() macro.

From: Segher Boessenkool
Date: Sun Dec 31 2006 - 22:00:56 EST

+#define KFREE(x) \
+ do { \
+ kfree(x); \
+ x = NULL; \
+ } while(0)

This doesn't work correctly if "x" has side effects --
double evaluation. Use a temporary variable instead,
or better, an inline function. A better name wouldn't
hurt either (kfree_and_zero()?)


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at