Commit 3104bf03a923c72043a9c5009d9cd56724304916
Committed by
Ingo Molnar
1 parent
348ec61e62
Exists in
master
and in
7 other branches
sched: Fix out of scope variable access in sched_slice()
Access to local variable lw is aliased by usage of pointer load. Access to pointer load in calc_delta_mine() happens when lw is already out of scope. [ Reported by static code analysis. ] Signed-off-by: Christian Engelmayer <christian.engelmayer@frequentis.com> LKML-Reference: <20090616103512.0c846e51@frequentis.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Showing 1 changed file with 2 additions and 1 deletions Side-by-side Diff
kernel/sched_fair.c
... | ... | @@ -430,12 +430,13 @@ |
430 | 430 | |
431 | 431 | for_each_sched_entity(se) { |
432 | 432 | struct load_weight *load; |
433 | + struct load_weight lw; | |
433 | 434 | |
434 | 435 | cfs_rq = cfs_rq_of(se); |
435 | 436 | load = &cfs_rq->load; |
436 | 437 | |
437 | 438 | if (unlikely(!se->on_rq)) { |
438 | - struct load_weight lw = cfs_rq->load; | |
439 | + lw = cfs_rq->load; | |
439 | 440 | |
440 | 441 | update_load_add(&lw, se->load.weight); |
441 | 442 | load = &lw; |