[ft-lib/bcache] add a check to list_pop()
This commit is contained in:
parent
1122b9a423
commit
12c760f05c
@ -51,6 +51,9 @@ static inline struct list_head *list_pop(struct list_head *head)
|
||||
{
|
||||
struct list_head *l;
|
||||
|
||||
if (head->next == head)
|
||||
raise("list is empty\n");
|
||||
|
||||
l = head->next;
|
||||
list_del(l);
|
||||
return l;
|
||||
|
Loading…
Reference in New Issue
Block a user