Avoid leaking the memory mapping of the trace buffer
Coverity ID
1351228
Signed-off-by: Harmandeep Kaur <write.harmandeep@gmail.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
sysctl.u.tbuf_op.buffer_mfn);
if ( t_info == NULL || t_info->tbuf_size == 0 )
- return -1;
+ rc = -1;
+ else
+ *size = t_info->tbuf_size;
- *size = t_info->tbuf_size;
+ xenforeignmemory_unmap(xch->fmem, t_info, sysctl.u.tbuf_op.size);
- return 0;
+ return rc;
}
int xc_tbuf_enable(xc_interface *xch, unsigned long pages, unsigned long *mfn,