Re: [PATCH] netlink: Fix kfree NULL pointer

From: Eric Dumazet
Date: Wed Sep 08 2010 - 01:55:35 EST


Le mercredi 08 septembre 2010 Ã 13:33 +0800, jovi zhang a Ãcrit :

> YES, maybe kfree(NULL) is legal, but I cannot see there have any need
> to invoke kfree(NULL) in this function.
> Also I check kfree usage in other code, I havn't find any kfree(NULL) usage.

We have hundred call sites doing kfree(NULL), if it makes code shorter.

Its usually code path handling exceptions (errors if you prefer), and we
prefer to use ugly gotos, and even kfree(NULL), to make it as short as
possible.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/