On 09/05/14 17:45, Jon Medhurst (Tixy) wrote:
On Fri, 2014-05-09 at 14:36 +0100, Chris Redpath wrote:
}
@@ -7153,7 +7159,11 @@ static void hmp_force_up_migration(int this_cpu) } } orig = curr;
curr = hmp_get_heaviest_task(curr, 1);
curr = hmp_get_heaviest_task(curr, -1);
if (!curr) {
This case can't happen because hmp_get_heaviest_task can only return zero when we specify a target cpu. However, I like defensive programming and in not making too many assumptions in code, so not going to disagree with adding this check :-)
:-) Me too. Right now it's not possible to return a NULL pointer in this path, but it could become desirable or necessary in future and the author may assume that since the function could previously return NULL pointers, all callers must handle such cases.
[...]