x86/mm: Fix infinite loop in get_spage_pages()

c/s 2b8eb37 switched int i to being unsigned, but the undo logic on failure
relied in i being signed.  As i being unsigned in still preforable, adjust the
undo logic to work with an unsigned i.

Coverity-ID: 1413017
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Konrad Rzeszutek Will <konrad.wilk@oracle.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Andrew Cooper committed 2017-06-26 14:32:46 +01:00
1 parent d5f6383d9a
commit 5bba2b362f
1 file changed
+1 -1
+1 -1
View File
@@ -2687,7 +2687,7 @@ static int get_spage_pages(struct page_info *page, struct domain *d)
{
if ( !get_page_and_type(page, d, PGT_writable_page) )
{
while ( --i >= 0 )
while ( i-- > 0 )
put_page_and_type(--page);
return 0;
}
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.