tools/libs: xenforeignmemory_unmap_resource() should be idempotent...
PATCH 1/1 tools/libs: xenforeignmemory_unmap_resource() should be idempotent...
...and is not because linux osdep_xenforeignmemory_unmap_resource() is not.
Reported-by Andrew Cooper <[email protected]>
Signed-off-by Paul Durrant <[email protected]>
---
Cc: Andrew Cooper <[email protected]>
Cc: Ian Jackson <[email protected]>
Cc: Wei Liu <[email protected]>
This is an alternative to the similarly named patch posted by Andrew. This one fixes the underlying issue in the osdep implementation. Andrew requested this be backported to 4.11.
--- tools/libs/foreignmemory/linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/libs/foreignmemory/linux.c +1 -1
@@ -298,7 +298,7 @@ int osdep_xenforeignmemory_restrict(xenforeignmemory_handle *fmem,int osdep_xenforeignmemory_unmap_resource (xenforeignmemory_handle *fmem,xenforeignmemory_resource_handle *fres) { -return munmap (fres->addr, fres->nr_frames <<PAGE_SHIFT ); +return fres ?munmap (fres->addr, fres->nr_frames <<PAGE_SHIFT ) :0 ; } int osdep_xenforeignmemory_map_resource(
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 4 lines · Paul Durrant
...and is not because linux
osdep_xenforeignmemory_unmap_resource()is not.Reported-by Andrew Cooper <[email protected]>Signed-off-by Paul Durrant <[email protected]>
Acked-by Wei Liu <[email protected]>
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel