Skip to content

Commit

Permalink
sched: nominate preferred wakeup cpu, fix
Browse files Browse the repository at this point in the history
Andrew Morton reported:

> kernel/sched.c: In function 'schedule':
> kernel/sched.c:3679: warning: 'active_balance' may be used uninitialized in this function
>
> This warning is correct - the code is buggy.

In sched.c load_balance_newidle, there's real potential use of
uninitialised variable - fix it.

Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
svaidy authored and Ingo Molnar committed Dec 23, 2008
1 parent b77b881 commit 36dffab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -3670,7 +3670,7 @@ load_balance_newidle(int this_cpu, struct rq *this_rq, struct sched_domain *sd,
}

if (!ld_moved) {
int active_balance;
int active_balance = 0;

schedstat_inc(sd, lb_failed[CPU_NEWLY_IDLE]);
if (!sd_idle && sd->flags & SD_SHARE_CPUPOWER &&
Expand Down

0 comments on commit 36dffab

Please sign in to comment.