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

Segher Boessenkool
2007-01-01T03:00:39Z

> +#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()?)

Segher