> +     if (dirty)
> +             kvm_release_pfn_dirty(map->pfn);
> +     else
> +             kvm_release_pfn_clean(map->pfn);
> +     map->hva = NULL;

I keep on having this gnawing feeling that we MUST set map->page to
NULL.

That is I can see how it is not needed if you are using 'map' and
'unmap' together - for that we are good. But what I am worried is that
some one unmaps it .. and instead of checking map->hva they end up
checking map->page and think the page is mapped.

Would you be OK adding that extra statement just as a fail-safe
mechanism in case someones misues the APIs?

Reply via email to