git.openpandora.org
/
pandora-kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4fbb67e
)
xen/grant-table: refactor error cleanup in grow_gnttab_list()
author
Chen Gang
<gang.chen.5i5j@gmail.com>
Tue, 26 Aug 2014 15:38:44 +0000
(23:38 +0800)
committer
Stefano Stabellini
<stefano.stabellini@eu.citrix.com>
Tue, 23 Sep 2014 13:36:18 +0000
(13:36 +0000)
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>
drivers/xen/grant-table.c
patch
|
blob
|
history
diff --git
a/drivers/xen/grant-table.c
b/drivers/xen/grant-table.c
index
c254ae0
..
7786291
100644
(file)
--- 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;
}