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

[Xen-changelog] [qemu-xen master] 9pfs: adjust the order of resource cleanup in device unrealize



commit 4774718e5c194026ba5ee7a28d9be49be3080e42
Author:     Li Qiang <liq3ea@xxxxxxxxx>
AuthorDate: Wed Nov 23 13:53:34 2016 +0100
Commit:     Greg Kurz <groug@xxxxxxxx>
CommitDate: Wed Nov 23 13:53:34 2016 +0100

    9pfs: adjust the order of resource cleanup in device unrealize
    
    Unrealize should undo things that were set during realize in
    reverse order. So should do in the error path in realize.
    
    Signed-off-by: Li Qiang <liq3ea@xxxxxxxxx>
    Reviewed-by: Greg Kurz <groug@xxxxxxxx>
    Signed-off-by: Greg Kurz <groug@xxxxxxxx>
---
 hw/9pfs/9p.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index aea7e9d..087b5c9 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -3521,8 +3521,8 @@ int v9fs_device_realize_common(V9fsState *s, Error **errp)
     rc = 0;
 out:
     if (rc) {
-        g_free(s->ctx.fs_root);
         g_free(s->tag);
+        g_free(s->ctx.fs_root);
         v9fs_path_free(&path);
     }
     return rc;
@@ -3530,8 +3530,8 @@ out:
 
 void v9fs_device_unrealize_common(V9fsState *s, Error **errp)
 {
-    g_free(s->ctx.fs_root);
     g_free(s->tag);
+    g_free(s->ctx.fs_root);
 }
 
 typedef struct VirtfsCoResetData {
--
generated by git-patchbot for /home/xen/git/qemu-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®.