Browse Source

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>
Chen Gang 11 years ago
parent
commit
46e3626adb
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/xen/grant-table.c

+ 1 - 1
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;
 }