diff options
-rw-r--r-- | mdstat.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -123,13 +123,15 @@ static void mdstat_ent_list_detach_element(struct mdstat_ent **list_head, struct ent->next = el->next; break; } + + ent = ent->next; } - ent = ent->next; } + /* Guard if not found or list is empty - not allowed */ assert(ent); - ent->next = NULL; + el->next = NULL; } void free_mdstat(struct mdstat_ent *ms) |