If xc_gntshr_open failed the only thing to cleanup is free allocated
memory. So instead of calling libxenvchan_close (which assume
valid calculated buffers being mmaped already) free memory and return.
Signed-off-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
}
ctrl->gntshr = xengntshr_open(logger, 0);
- if (!ctrl->gntshr)
- goto out;
+ if (!ctrl->gntshr) {
+ free(ctrl);
+ return 0;
+ }
if (init_evt_srv(ctrl, domain, logger))
goto out;