mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
1 parent
d5f6383d9a
commit
5bba2b362f
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||