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@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
ret = osdep_xenforeignmemory_map(fmem, dom, prot, num, arr, err);
- if ( ret == 0 && err_to_free )
+ if ( ret && err_to_free )
{
int i;