diff options
Diffstat (limited to 'drivers/xen/gntalloc.c')
-rw-r--r-- | drivers/xen/gntalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/xen/gntalloc.c b/drivers/xen/gntalloc.c index 8ed2bb4f6f21..e53fe191738c 100644 --- a/drivers/xen/gntalloc.c +++ b/drivers/xen/gntalloc.c | |||
@@ -124,7 +124,7 @@ static int add_grefs(struct ioctl_gntalloc_alloc_gref *op, | |||
124 | int i, rc, readonly; | 124 | int i, rc, readonly; |
125 | LIST_HEAD(queue_gref); | 125 | LIST_HEAD(queue_gref); |
126 | LIST_HEAD(queue_file); | 126 | LIST_HEAD(queue_file); |
127 | struct gntalloc_gref *gref; | 127 | struct gntalloc_gref *gref, *next; |
128 | 128 | ||
129 | readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE); | 129 | readonly = !(op->flags & GNTALLOC_FLAG_WRITABLE); |
130 | rc = -ENOMEM; | 130 | rc = -ENOMEM; |
@@ -160,8 +160,8 @@ undo: | |||
160 | mutex_lock(&gref_mutex); | 160 | mutex_lock(&gref_mutex); |
161 | gref_size -= (op->count - i); | 161 | gref_size -= (op->count - i); |
162 | 162 | ||
163 | list_for_each_entry(gref, &queue_file, next_file) { | 163 | list_for_each_entry_safe(gref, next, &queue_file, next_file) { |
164 | /* __del_gref does not remove from queue_file */ | 164 | list_del(&gref->next_file); |
165 | __del_gref(gref); | 165 | __del_gref(gref); |
166 | } | 166 | } |
167 | 167 | ||