[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] libxenforeignmemory: handle partial failure correctly
commit cc449379d9932c2fec23c5b8e838e01c837660a7 Author: Ian Campbell <ian.campbell@xxxxxxxxxx> AuthorDate: Wed Feb 3 10:10:01 2016 +0000 Commit: Ian Campbell <ian.campbell@xxxxxxxxxx> CommitDate: Wed Feb 3 11:23:08 2016 +0000 libxenforeignmemory: handle partial failure correctly Coverity rightly points out that checking for ret == NULL and then calling osdep unmap(ret) is wrong. The intention on this code path is to turn partial failure into total failure when the err argument is NULL, so we want to take this patch whenever ret is _non_ NULL (and err_to_free is set, indicating err was NULL). CID: 1351219 Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx> Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> --- tools/libs/foreignmemory/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c index cfb0a73..a5110a7 100644 --- a/tools/libs/foreignmemory/core.c +++ b/tools/libs/foreignmemory/core.c @@ -78,7 +78,7 @@ void *xenforeignmemory_map(xenforeignmemory_handle *fmem, ret = osdep_xenforeignmemory_map(fmem, dom, prot, num, arr, err); - if ( ret == 0 && err_to_free ) + if ( ret && err_to_free ) { int i; -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |