[ft-lib/bcache] add a check to list_pop()
This commit is contained in:
1 parent
1122b9a423
commit
12c760f05c
1 file changed
+3
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user