| Subject | Re: PATCH, RFC: 2.6 Documentation/Codingstyle | From | Valdis.Kletnieks@vt ... | Date | Fri, 13 Feb 2004 19:56:37 -0500 |
| |
On Fri, 13 Feb 2004 19:38:21 EST, "Kevin O'Connor" said:
> 1 - kfree already checks for null, so checking for null before calling > kfree is pointless.
As anybody who's chased a 'null pointer dereference' OOPS, plenty of stuff in the kernel DOESN'T check for null. And this is a *style* document, not a calling conventions document (unless we're documenting the use of kmalloc/kfree as well as layout?
If we're doing that, we may well want to expand it slightly to cover the case of 2 kmallocs, a 'goto out1' and 'goto out2' to demonstrate proper unwinding/freeing.... [unhandled content-type:application/pgp-signature] |