From patchwork Tue Nov 15 01:38:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9428741 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DEEE760484 for ; Tue, 15 Nov 2016 01:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1B0F289F9 for ; Tue, 15 Nov 2016 01:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C664928A05; Tue, 15 Nov 2016 01:39:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 56DD6289F9 for ; Tue, 15 Nov 2016 01:39:29 +0000 (UTC) Received: from localhost ([::1]:43550 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c6Sic-0006tv-9o for patchwork-qemu-devel@patchwork.kernel.org; Mon, 14 Nov 2016 20:39:26 -0500 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:from:to:cc:subject:date; bh=vdXzzjfQAYVjQ7mi1mQcV2f2v+xo8m17JhP1P5++PU4=; b=Zc0P/EZ9L70PkqirB5RrmFnkzg4XbU1xjp/PmQsWVFgJInBptXfnaLU9Pve7qCIVRz qmK1OA+6SPZ/kTIlmYidw4yKrTKoLEjbswGNoZQB9x8xxetxyPXUEhhrnyxmXzDpt51Y 4mEx6FpV3wQeH5JJxbLMKKIl0SRS/vYSbTpRXf9QTOzKdl12Ks68zVpviwJhdU7qHC0H 66jFrWlKVwSpVKikYMYrah/2hJrvS5xoW1mSAedfYRqTsykufaeuUCJbpgMmnnbWc8cs 0gnB/uK7r5BsBSc53uolJ6ioUPu/W4qYDKa2AnvrC8JSdHwwSdC5aaNGKqRIqBJ54Znk jZTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:from:to:cc:subject:date; bh=vdXzzjfQAYVjQ7mi1mQcV2f2v+xo8m17JhP1P5++PU4=; b=W/CADEdTR/esemC8mHS6dK1Nfb++sRrMSYtQGy7Y+nnkBVuHxhF6cbvfddfsuXohpo cWA5S5ZxhE+ruj0ttchmM78JMsi1/nX22BY/PgsKD5/Dyoyh/pJiXlTyzWzF0p1IsNO0 GlXfAx7QEGOD6h16+DSKOsMy7gjWLB3723lTMBPb9DBICKe9EmYptYC+WIW3FCvUCJmF 9jS+U/7Cl9EUDfE5ZxP3ciLjfym6Pf0XJfCo0NFTj8WGu6b3WugUkhoRUE0wNfm92YQ2 RSpbfIu4m2pF6dLa9+vuvvLfaJK2YB8yr3nCvAkf/tcf/Tq+eCKkxBR1Rd6qtevvNPGJ gbCw== X-Gm-Message-State: ABUngvey/K4h9JlGL0bcdgR07+f0B8Q0YZZHL16MKDAUG+nSjk6Zu/8SO+D51CbqShSegQ== X-Received: by 10.36.16.130 with SMTP id 124mr938401ity.112.1479173945187; Mon, 14 Nov 2016 17:39:05 -0800 (PST) Received: from localhost.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id o144sm10462702iod.40.2016.11.14.17.39.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Nov 2016 17:39:04 -0800 (PST) Message-ID: <582a6738.968c6b0a.ad67a.9505@mx.google.com> X-Google-Original-Message-ID: <1479173937-34042-1-git-send-email-Qiang(liq3ea@gmail.com)> From: Li Qiang X-Google-Original-From: Li Qiang(liq3ea@gmail.com) To: groug@kaod.org, qemu-devel@nongnu.org Date: Mon, 14 Nov 2016 20:38:57 -0500 X-Mailer: git-send-email 1.8.3.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c0b::242 Subject: [Qemu-devel] [PATCH] 9pfs: adjust the order of resource cleanup in device unrealize X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Li Qiang Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 {