提交 46e3626a 编写于 作者: C Chen Gang 提交者: Stefano Stabellini

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: NChen Gang <gang.chen.5i5j@gmail.com>
Signed-off-by: NDavid Vrabel <david.vrabel@citrix.com>
上级 4fbb67e3
...@@ -592,7 +592,7 @@ static int grow_gnttab_list(unsigned int more_frames) ...@@ -592,7 +592,7 @@ static int grow_gnttab_list(unsigned int more_frames)
return 0; return 0;
grow_nomem: grow_nomem:
for ( ; i >= nr_glist_frames; i--) while (i-- > nr_glist_frames)
free_page((unsigned long) gnttab_list[i]); free_page((unsigned long) gnttab_list[i]);
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册