Skip to contentSkip to conversation

don't do pointless NULL checks and casts before kfree() in security/

PATCH Bodo Eggert 1 participant 1 message Mar 20, 2005 2 messages not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 7 lines · Ralph Corderoy

Hi Jesper,

Quoted 2 lines

kfree() handles NULL pointers, so checking a pointer for NULL before calling kfree() on it is pointless.

Not necessarily. It helps tell the reader that the pointer may be NULL at that point. This has come up before.

If you want to comment code, use comments.