if (foo) {
kfree(foo);
foo = NULL;
}
frob();
we can /* as whoever wrote kfree intended */
kfree(foo);
foo = NULL;
frob();
I would think in any case if we were looking at optimisation, the
assignment is roughly on par with the compare and saves you a bit on the
other case.
Alan Cox also suggested the BUG() trigger in there, with the
resultant breakage that would bring about. But i think its ok as long as
you don't call kfree with uninitialised variables or some such or forget
to set them to NULL at some point.
Thanks,
Zwane Mwaikambo
-
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/