Skip to contentSkip to conversation

kfree calls cleanup

PATCH In review Benoît Dejean 2 participants 2 messages May 24, 2004 – Jun 2, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kfree calls cleanup

i've removed some useless test for NULL pointer before kfree calls. if(p) kfree(p) -> kfree(p)
i've also removed variables that have become unused.
the patch is quite big, but i've check it many times.

Signature · 4 lines
Benoît Dejean
JID: [email protected]
http://gdesklets.gnomedesktop.org
http://www.paulla.asso.fr
#1 lore raw
Quoted 4 lines · Benoît Dejean

i've removed some useless test for NULL pointer before kfree calls. if(p) kfree(p) -> kfree(p)
i've also removed variables that have become unused.
the patch is quite big, but i've check it many times.

This is valid since kfree checks for null pointer, but while the extra "if (p)" is redundant, if p is most often NULL somewhere, then you can avoid the function call overhead by this very low-cost check. (Unless kfree is a macro which includes the check in the macro.)