diff options
Diffstat (limited to 'firmware/kernel.c')
-rw-r--r-- | firmware/kernel.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/firmware/kernel.c b/firmware/kernel.c index f8b9cec2e1..614f9cf402 100644 --- a/firmware/kernel.c +++ b/firmware/kernel.c | |||
@@ -86,21 +86,28 @@ void queue_init(struct event_queue *q) | |||
86 | void queue_delete(struct event_queue *q) | 86 | void queue_delete(struct event_queue *q) |
87 | { | 87 | { |
88 | int i; | 88 | int i; |
89 | bool found = false; | ||
89 | 90 | ||
90 | /* Find the queue to be deleted */ | 91 | /* Find the queue to be deleted */ |
91 | for(i = 0;i < num_queues;i++) | 92 | for(i = 0;i < num_queues;i++) |
92 | { | 93 | { |
93 | if(all_queues[i] == q) | 94 | if(all_queues[i] == q) |
95 | { | ||
96 | found = true; | ||
94 | break; | 97 | break; |
98 | } | ||
95 | } | 99 | } |
96 | 100 | ||
97 | /* Move the following queues up in the list */ | 101 | if(found) |
98 | for(;i < num_queues-1;i++) | ||
99 | { | 102 | { |
100 | all_queues[i] = all_queues[i+1]; | 103 | /* Move the following queues up in the list */ |
104 | for(;i < num_queues-1;i++) | ||
105 | { | ||
106 | all_queues[i] = all_queues[i+1]; | ||
107 | } | ||
108 | |||
109 | num_queues--; | ||
101 | } | 110 | } |
102 | |||
103 | num_queues--; | ||
104 | } | 111 | } |
105 | 112 | ||
106 | void queue_wait(struct event_queue *q, struct event *ev) | 113 | void queue_wait(struct event_queue *q, struct event *ev) |