[ft-lib/bcache] add a check to list_pop()

This commit is contained in:
Joe Thornber 2018-01-25 15:47:12 +00:00
parent 1122b9a423
commit 12c760f05c
1 changed files with 3 additions and 0 deletions

View File

@ -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;