[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-3104bf03a923c72043a9c5009d9cd56724304916@git.kernel.org>
Date: Wed, 17 Jun 2009 16:39:34 GMT
From: tip-bot for Christian Engelmayer
<christian.engelmayer@...quentis.com>
To: linux-tip-commits@...r.kernel.org
Cc: linux-kernel@...r.kernel.org, christian.engelmayer@...quentis.com,
hpa@...or.com, mingo@...hat.com, tglx@...utronix.de, mingo@...e.hu
Subject: [tip:sched/urgent] sched: Fix out of scope variable access in sched_slice()
Commit-ID: 3104bf03a923c72043a9c5009d9cd56724304916
Gitweb: http://git.kernel.org/tip/3104bf03a923c72043a9c5009d9cd56724304916
Author: Christian Engelmayer <christian.engelmayer@...quentis.com>
AuthorDate: Tue, 16 Jun 2009 10:35:12 +0200
Committer: Ingo Molnar <mingo@...e.hu>
CommitDate: Wed, 17 Jun 2009 18:37:54 +0200
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@...quentis.com>
LKML-Reference: <20090616103512.0c846e51@...quentis.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>
---
kernel/sched_fair.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 5f9650e..ba7fd6e 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -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;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists