* [PATCH] tools/libs: xenforeignmemory_unmap_resource() should be idempotent...
@ 2018-11-27 16:39 Paul Durrant
2018-11-27 16:41 ` Wei Liu
0 siblings, 1 reply; 2+ messages in thread
From: Paul Durrant @ 2018-11-27 16:39 UTC (permalink / raw)
To: xen-devel; +Cc: Andrew Cooper, Paul Durrant, Wei Liu, Ian Jackson
...and is not because linux osdep_xenforeignmemory_unmap_resource() is not.
Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Paul Durrant <paul.durrant@citrix.com>
---
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Ian Jackson <Ian.Jackson@citrix.com>
Cc: Wei Liu <wei.liu2@citrix.com>
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(-)
diff --git a/tools/libs/foreignmemory/linux.c b/tools/libs/foreignmemory/linux.c
index 132875df8a..8daa5828e3 100644
--- a/tools/libs/foreignmemory/linux.c
+++ b/tools/libs/foreignmemory/linux.c
@@ -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(
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-27 16:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-27 16:39 [PATCH] tools/libs: xenforeignmemory_unmap_resource() should be idempotent Paul Durrant
2018-11-27 16:41 ` Wei Liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.