aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjoern B. Brandenburg <bbb@cs.unc.edu>2010-09-22 15:53:43 -0400
committerBjoern B. Brandenburg <bbb@cs.unc.edu>2010-09-22 15:53:43 -0400
commitb6b0dea022817922165d2848aef9952dec0697ee (patch)
tree7e7a5c76f427b68b1095ee350d2dd1cfebeb928e
parent83866f38a561f73958a50f0f2eee67eb09199fc2 (diff)
EDF-WM: make sure a sliced task has its fields initialized
This created a juicy NULL dereference due to wm.slice being NULL.
-rw-r--r--litmus/sched_edf_wm.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/litmus/sched_edf_wm.c b/litmus/sched_edf_wm.c
index 4266b1019f52..34f8421afdf5 100644
--- a/litmus/sched_edf_wm.c
+++ b/litmus/sched_edf_wm.c
@@ -395,6 +395,16 @@ static void wm_task_new(struct task_struct * t, int on_rq, int running)
395 * code will try to wake it up with fatal consequences. 395 * code will try to wake it up with fatal consequences.
396 */ 396 */
397 raw_spin_lock_irqsave(&dom->slock, flags); 397 raw_spin_lock_irqsave(&dom->slock, flags);
398
399 if (is_sliced_task(t)) {
400 /* make sure parameters are initialized consistently */
401 tsk_rt(t)->semi_part.wm.exec_time = 0;
402 tsk_rt(t)->semi_part.wm.job_release = get_release(t);
403 tsk_rt(t)->semi_part.wm.job_deadline = get_deadline(t);
404 tsk_rt(t)->semi_part.wm.slice = tsk_rt(t)->task_params.semi_part.wm.slices;
405 tsk_rt(t)->job_params.exec_time = 0;
406 }
407
398 if (running) { 408 if (running) {
399 /* there shouldn't be anything else running at the time */ 409 /* there shouldn't be anything else running at the time */
400 BUG_ON(dom->scheduled); 410 BUG_ON(dom->scheduled);