diff options
author | Chen Gang <gang.chen.5i5j@gmail.com> | 2014-08-26 11:38:44 -0400 |
---|---|---|
committer | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2014-09-23 09:36:18 -0400 |
commit | 46e3626adb86be2ff1321d26107cb75df07a7f4e (patch) | |
tree | 8f8c4086c020ba9f22e180b8177e7d2816aad5a4 | |
parent | 4fbb67e3c87b806ad54445a1b4a9c6bde2359c98 (diff) |
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>
-rw-r--r-- | drivers/xen/grant-table.c | 2 |
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) | |||
592 | return 0; | 592 | return 0; |
593 | 593 | ||
594 | grow_nomem: | 594 | grow_nomem: |
595 | for ( ; i >= nr_glist_frames; i--) | 595 | while (i-- > nr_glist_frames) |
596 | free_page((unsigned long) gnttab_list[i]); | 596 | free_page((unsigned long) gnttab_list[i]); |
597 | return -ENOMEM; | 597 | return -ENOMEM; |
598 | } | 598 | } |