qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize
@ 2016-11-15  1:38 Li Qiang
  2016-11-15 10:15 ` Greg Kurz
  0 siblings, 1 reply; 2+ messages in thread
From: Li Qiang @ 2016-11-15  1:38 UTC (permalink / raw)
  To: groug, qemu-devel; +Cc: Li Qiang

From: Li Qiang <liq3ea@gmail.com>

Unrealize should undo things that were set during realize in
reverse order. This is what this patch does.

Signed-off-by: Li Qiang <liq3ea@gmail.com>
---
 hw/9pfs/9p.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
index aea7e9d..f7e14ac 100644
--- a/hw/9pfs/9p.c
+++ b/hw/9pfs/9p.c
@@ -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 {
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize
  2016-11-15  1:38 [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize Li Qiang
@ 2016-11-15 10:15 ` Greg Kurz
  0 siblings, 0 replies; 2+ messages in thread
From: Greg Kurz @ 2016-11-15 10:15 UTC (permalink / raw)
  To: Li Qiang; +Cc: qemu-devel

Hi Li,

Please incorporate this patch in your cleanup series since it depends on it.

On Mon, 14 Nov 2016 20:38:57 -0500
Li Qiang <liq3ea@gmail.com> wrote:

> From: Li Qiang <liq3ea@gmail.com>
> 
> Unrealize should undo things that were set during realize in
> reverse order. This is what this patch does.
> 

So should do the error path in realize actually. :)

> Signed-off-by: Li Qiang <liq3ea@gmail.com>
> ---
>  hw/9pfs/9p.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c
> index aea7e9d..f7e14ac 100644
> --- a/hw/9pfs/9p.c
> +++ b/hw/9pfs/9p.c
> @@ -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 {

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-11-15 10:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-15  1:38 [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize Li Qiang
2016-11-15 10:15 ` Greg Kurz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).