diff options
Diffstat (limited to 'firmware/common')
-rw-r--r-- | firmware/common/linked_list.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/firmware/common/linked_list.c b/firmware/common/linked_list.c index a5b3de3cf7..b8f2dd181c 100644 --- a/firmware/common/linked_list.c +++ b/firmware/common/linked_list.c | |||
@@ -198,16 +198,14 @@ void lld_remove(struct lld_head *list, struct lld_node *node) | |||
198 | struct lld_node *next = node->next; | 198 | struct lld_node *next = node->next; |
199 | struct lld_node *prev = node->prev; | 199 | struct lld_node *prev = node->prev; |
200 | 200 | ||
201 | if (node == list->head) | 201 | if (prev == NULL) |
202 | list->head = next; | 202 | list->head = next; |
203 | 203 | else | |
204 | if (node == list->tail) | ||
205 | list->tail = prev; | ||
206 | |||
207 | if (prev != NULL) | ||
208 | prev->next = next; | 204 | prev->next = next; |
209 | 205 | ||
210 | if (next != NULL) | 206 | if (next == NULL) |
207 | list->tail = prev; | ||
208 | else | ||
211 | next->prev = prev; | 209 | next->prev = prev; |
212 | } | 210 | } |
213 | 211 | ||