mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
libvchan: Fix cleanup when xc_gntshr_open failed
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>
This commit is contained in:
1 parent
49b1ea9e0e
commit
a3a87d27a3
1 file changed
+4
-2
@@ -329,8 +329,10 @@ struct libxenvchan *libxenvchan_server_init(struct xentoollog_logger *logger,
|
||||
}
|
||||
|
||||
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;
|
||||
|
||||