| .. | .. |
|---|
| 1696 | 1696 | rt_queue_push_tasks(rq); |
|---|
| 1697 | 1697 | } |
|---|
| 1698 | 1698 | |
|---|
| 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) |
|---|
| 1701 | 1700 | { |
|---|
| 1702 | 1701 | struct rt_prio_array *array = &rt_rq->active; |
|---|
| 1703 | 1702 | struct sched_rt_entity *next = NULL; |
|---|
| .. | .. |
|---|
| 1708 | 1707 | BUG_ON(idx >= MAX_RT_PRIO); |
|---|
| 1709 | 1708 | |
|---|
| 1710 | 1709 | queue = array->queue + idx; |
|---|
| 1710 | + if (SCHED_WARN_ON(list_empty(queue))) |
|---|
| 1711 | + return NULL; |
|---|
| 1711 | 1712 | next = list_entry(queue->next, struct sched_rt_entity, run_list); |
|---|
| 1712 | 1713 | |
|---|
| 1713 | 1714 | return next; |
|---|
| .. | .. |
|---|
| 1719 | 1720 | struct rt_rq *rt_rq = &rq->rt; |
|---|
| 1720 | 1721 | |
|---|
| 1721 | 1722 | 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; |
|---|
| 1724 | 1726 | rt_rq = group_rt_rq(rt_se); |
|---|
| 1725 | 1727 | } while (rt_rq); |
|---|
| 1726 | 1728 | |
|---|