Received: from eggs.gnu.org ([2001:4830:134:3::10]:52787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6SiL-0006tp-1z for qemu-devel@nongnu.org; Mon, 14 Nov 2016 20:39:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c6SiH-0004BW-VP for qemu-devel@nongnu.org; Mon, 14 Nov 2016 20:39:09 -0500 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]:36046) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c6SiH-0004BJ-RB for qemu-devel@nongnu.org; Mon, 14 Nov 2016 20:39:05 -0500 Received: by mail-it0-x242.google.com with SMTP id n68so18446923itn.3 for ; Mon, 14 Nov 2016 17:39:05 -0800 (PST) Message-ID: <582a6738.968c6b0a.ad67a.9505@mx.google.com> From: Li Qiang Date: Mon, 14 Nov 2016 20:38:57 -0500 Subject: [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: groug@kaod.org, qemu-devel@nongnu.org Cc: Li Qiang From: Li Qiang Unrealize should undo things that were set during realize in reverse order. This is what this patch does. Signed-off-by: Li Qiang --- 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