aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/litmus.c
diff options
context:
space:
mode:
authorNathan O <otternes@cs.unc.edu>2019-12-19 14:04:21 -0500
committerNathan O <otternes@cs.unc.edu>2019-12-19 14:04:21 -0500
commit665d44284956094a722b4692ed07df1f692d0232 (patch)
treeab2ca695494526cca1f03a874ccdef354d9f5b83 /kernel/sched/litmus.c
parentec01ea7a3f09d246ab322f828d6c66b2704be485 (diff)
Fix kernel segfault on boot
- Since the last version of LITMUS, the pick_next_task function for scheduler classes has changed a bit; now the "prev" argument can be NULL. This change fixes how LITMUS' scheduler class stubs handle this, but further attention may need to be given to fix the non-default LITMUS plugins.
Diffstat (limited to 'kernel/sched/litmus.c')
-rw-r--r--kernel/sched/litmus.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sched/litmus.c b/kernel/sched/litmus.c
index aa43ed1e9eb5..468aa0197d1d 100644
--- a/kernel/sched/litmus.c
+++ b/kernel/sched/litmus.c
@@ -273,7 +273,7 @@ static struct task_struct *pick_next_task_litmus(struct rq *rq,
273 if (rf) { 273 if (rf) {
274 cookie = rf->cookie; 274 cookie = rf->cookie;
275 } 275 }
276 if (is_realtime(prev)) 276 if (prev && is_realtime(prev))
277 update_time_litmus(rq, prev); 277 update_time_litmus(rq, prev);
278 278
279 lockdep_unpin_lock(&rq->lock, cookie); 279 lockdep_unpin_lock(&rq->lock, cookie);
@@ -291,7 +291,7 @@ static struct task_struct *pick_next_task_litmus(struct rq *rq,
291 * provide a task, and if we find one, call put_prev_task() on the 291 * provide a task, and if we find one, call put_prev_task() on the
292 * previously scheduled task. 292 * previously scheduled task.
293 */ 293 */
294 if (next) 294 if (next && prev)
295 put_prev_task(rq, prev); 295 put_prev_task(rq, prev);
296 296
297 return next; 297 return next;