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

[xen staging] tools: fix error path of xenhypfs_open()



commit 30a72f028707d8cdc7951b50268e33818497596e
Author:     Juergen Gross <jgross@xxxxxxxx>
AuthorDate: Tue Jun 9 16:48:49 2020 +0200
Commit:     Wei Liu <wl@xxxxxxx>
CommitDate: Tue Jun 9 15:35:15 2020 +0000

    tools: fix error path of xenhypfs_open()
    
    In case of an error in xenhypfs_open() the error path will cause a
    segmentation fault due to a wrong sequence of closing calls.
    
    Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Fixes: 86234eafb9529 ("libs: add libxenhypfs")
    Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
    Reviewed-by: Paul Durrant <paul@xxxxxxx>
    Release-acked-by: Paul Durrant <paul@xxxxxxx>
    Acked-by: Wei Liu <wl@xxxxxxx>
---
 tools/libs/hypfs/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/libs/hypfs/core.c b/tools/libs/hypfs/core.c
index c91e165705..fc23b02586 100644
--- a/tools/libs/hypfs/core.c
+++ b/tools/libs/hypfs/core.c
@@ -74,8 +74,8 @@ xenhypfs_handle *xenhypfs_open(xentoollog_logger *logger,
     return fshdl;
 
 err:
-    xtl_logger_destroy(fshdl->logger_tofree);
     xencall_close(fshdl->xcall);
+    xtl_logger_destroy(fshdl->logger_tofree);
     free(fshdl);
     return NULL;
 }
--
generated by git-patchbot for /home/xen/git/xen.git#staging



 


Rackspace

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