summaryrefslogtreecommitdiffstats
path: root/drivers/xen/grant-table.c
diff options
context:
space:
mode:
authorChen Gang <gang.chen.5i5j@gmail.com>2014-08-26 17:38:44 +0200
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2014-09-23 15:36:18 +0200
commit46e3626adb86be2ff1321d26107cb75df07a7f4e (patch)
tree8f8c4086c020ba9f22e180b8177e7d2816aad5a4 /drivers/xen/grant-table.c
parentxen/setup: Remap Xen Identity Mapped RAM (diff)
downloadlinux-46e3626adb86be2ff1321d26107cb75df07a7f4e.tar.xz
linux-46e3626adb86be2ff1321d26107cb75df07a7f4e.zip
xen/grant-table: refactor error cleanup in grow_gnttab_list()
The cleanup loop in grow_gnttab_list() is safe from the underflow of the unsigned 'i' since nr_glist_frames is >= 1, but refactor it anyway. Signed-off-by: Chen Gang <gang.chen.5i5j@gmail.com> Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Diffstat (limited to 'drivers/xen/grant-table.c')
-rw-r--r--drivers/xen/grant-table.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index c254ae036f18..7786291ba229 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -592,7 +592,7 @@ static int grow_gnttab_list(unsigned int more_frames)
return 0;
grow_nomem:
- for ( ; i >= nr_glist_frames; i--)
+ while (i-- > nr_glist_frames)
free_page((unsigned long) gnttab_list[i]);
return -ENOMEM;
}