Module: xenomai-3
Branch: next
Commit: 5278d83ea3a108bbf3bc579e7b7f9e2048bf33f0
URL:    
http://git.xenomai.org/?p=xenomai-3.git;a=commit;h=5278d83ea3a108bbf3bc579e7b7f9e2048bf33f0

Author: Philippe Gerum <r...@xenomai.org>
Date:   Sun Oct 26 17:58:43 2014 +0100

cobalt/sched/tp: detect assignment to unconfigured CPU

---

 kernel/cobalt/sched-tp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/kernel/cobalt/sched-tp.c b/kernel/cobalt/sched-tp.c
index d3e7f5f..7ce04c1 100644
--- a/kernel/cobalt/sched-tp.c
+++ b/kernel/cobalt/sched-tp.c
@@ -158,8 +158,10 @@ static int xnsched_tp_declare(struct xnthread *thread,
                              const union xnsched_policy_param *p)
 {
        struct xnsched *sched = thread->sched;
+       struct xnsched_tp *tp = &sched->tp;
 
-       if (p->tp.prio < XNSCHED_TP_MIN_PRIO ||
+       if (tp->gps == NULL ||
+           p->tp.prio < XNSCHED_TP_MIN_PRIO ||
            p->tp.prio > XNSCHED_TP_MAX_PRIO)
                return -EINVAL;
 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to