hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/kernel/sched/rt.c
....@@ -1696,8 +1696,7 @@
16961696 rt_queue_push_tasks(rq);
16971697 }
16981698
1699
-static struct sched_rt_entity *pick_next_rt_entity(struct rq *rq,
1700
- struct rt_rq *rt_rq)
1699
+static struct sched_rt_entity *pick_next_rt_entity(struct rt_rq *rt_rq)
17011700 {
17021701 struct rt_prio_array *array = &rt_rq->active;
17031702 struct sched_rt_entity *next = NULL;
....@@ -1708,6 +1707,8 @@
17081707 BUG_ON(idx >= MAX_RT_PRIO);
17091708
17101709 queue = array->queue + idx;
1710
+ if (SCHED_WARN_ON(list_empty(queue)))
1711
+ return NULL;
17111712 next = list_entry(queue->next, struct sched_rt_entity, run_list);
17121713
17131714 return next;
....@@ -1719,8 +1720,9 @@
17191720 struct rt_rq *rt_rq = &rq->rt;
17201721
17211722 do {
1722
- rt_se = pick_next_rt_entity(rq, rt_rq);
1723
- BUG_ON(!rt_se);
1723
+ rt_se = pick_next_rt_entity(rt_rq);
1724
+ if (unlikely(!rt_se))
1725
+ return NULL;
17241726 rt_rq = group_rt_rq(rt_se);
17251727 } while (rt_rq);
17261728