On 02/02/15 11:20, Jan Beulich wrote:
> Comparing its result against NULL is unsafe when page lists use normal
> list entries for linking together - page_list_empty() needs to be used
> instead.
>
> Signed-off-by: Jan Beulich <jbeul...@suse.com>

Reviewed-by: Andrew Cooper <andrew.coop...@citrix.com>

>
> --- a/xen/drivers/passthrough/x86/iommu.c
> +++ b/xen/drivers/passthrough/x86/iommu.c
> @@ -85,8 +85,9 @@ int arch_iommu_populate_page_table(struc
>           * first few entries.
>           */
>          page_list_move(&d->page_list, &d->arch.relmem_list);
> -        while ( (page = page_list_first(&d->page_list)) != NULL &&
> -                (page->count_info & (PGC_state|PGC_broken)) )
> +        while ( !page_list_empty(&d->page_list) &&
> +                (page = page_list_first(&d->page_list),
> +                 (page->count_info & (PGC_state|PGC_broken))) )
>          {
>              page_list_del(page, &d->page_list);
>              page_list_add_tail(page, &d->arch.relmem_list);
>
>
>


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to