]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
sched: Fix out of scope variable access in sched_slice()
authorChristian Engelmayer <christian.engelmayer@frequentis.com>
Tue, 16 Jun 2009 08:35:12 +0000 (10:35 +0200)
committerIngo Molnar <mingo@elte.hu>
Wed, 17 Jun 2009 16:37:54 +0000 (18:37 +0200)
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>
kernel/sched_fair.c

index 5f9650e8fe7587938de1bfa71e48cd4a04061d36..ba7fd6e9556f892dd941ecdd9e77be225929c251 100644 (file)
@@ -430,12 +430,13 @@ static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
 
        for_each_sched_entity(se) {
                struct load_weight *load;
+               struct load_weight lw;
 
                cfs_rq = cfs_rq_of(se);
                load = &cfs_rq->load;
 
                if (unlikely(!se->on_rq)) {
-                       struct load_weight lw = cfs_rq->load;
+                       lw = cfs_rq->load;
 
                        update_load_add(&lw, se->load.weight);
                        load = &lw;