[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] libvchan: Fix cleanup when xc_gntshr_open failed



commit a3a87d27a3de57ab5591d5d2604e6a5c6c806eab
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Jul 26 23:27:14 2017 +0200
Commit:     Wei Liu <wei.liu2@xxxxxxxxxx>
CommitDate: Fri Jul 28 17:46:14 2017 +0100

    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@xxxxxxxxxxxxxxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libvchan/init.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/libvchan/init.c b/tools/libvchan/init.c
index 83e1dee..e53f3a7 100644
--- a/tools/libvchan/init.c
+++ b/tools/libvchan/init.c
@@ -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;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.