Re: [PATCH] Removes extra checking in kernel/cpuset.c

From: James Kosin
Date: Thu Jul 31 2008 - 15:13:22 EST


Rakib Mullick wrote:
Hello guys, this patch removes an extra checking over 'cs' in
functions 'guarantee_online_cpus' and 'guarantee_online_mems'.

Thanks.

Signed-off-by: Md.Rakib H. Mullick (rakib.mullick@xxxxxxxxx)


I'd have to NAK this one as well. 2-reasons:
1) Your patch is guaranteed to generate a NULL pointer dereference at some point. You keep using cs; and assigning cs = cs->parent in the loop, at some point you may end up at the TOP of the tree where cs->parent == NULL.
2) The change breaks the actual meaning of the code. Which is suggesting my the short snippet, find an entry (while loop)... if the entry is found (if cs test), do this otherwise BUG out. Your code is saying, if cs is not NULL initially... find someplace then do something. The function never BUGS out unless someone calls with cs NULL initially.

James Kosin

Attachment: signature.asc
Description: OpenPGP digital signature