From patchwork Sat Nov 12 08:13:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Qiang X-Patchwork-Id: 9423977 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 6B7966047D for ; Sat, 12 Nov 2016 08:14:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52393299D8 for ; Sat, 12 Nov 2016 08:14:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 46E16299DB; Sat, 12 Nov 2016 08:14: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 ABBD8299D8 for ; Sat, 12 Nov 2016 08:14:29 +0000 (UTC) Received: from localhost ([::1]:57182 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5TSF-0003BP-0z for patchwork-qemu-devel@patchwork.kernel.org; Sat, 12 Nov 2016 03:14:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44306) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5TRz-0003B8-Iy for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5TRu-00050N-LO for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:11 -0500 Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]:34439) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c5TRu-00050J-GG for qemu-devel@nongnu.org; Sat, 12 Nov 2016 03:14:06 -0500 Received: by mail-it0-x243.google.com with SMTP id q124so1999794itd.1 for ; Sat, 12 Nov 2016 00:14:06 -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=BdeU7FfKwiGi/AO6tNTipfQefeEkSZ3wHSQTJcdsxWg=; b=a8m5oTJpnkaDyrY2h46meHjVX6FRJJrVu7GI95L0qf3kXvGu4Z9TRo+sAzso4p+Y6z 7ZSepGm38pDOLINKgMNjZiO+Zae7blLd1f2d06J1Jd/BKw4jSnWO6wXUV3O1uSYgXTZT V10g2TeD+IQ30KkvfApwLNkinljp/ISN7SnLoOWHX1DuOACYG4KgPdjLncX4ttGuCEeF oqPK7R2yF54TDftQ3Y24Y1G8owQRtuttRNQjMsnuCk2dMLKrCdZFul/JDrS4BTLsDQNS oEdvPIu0muNda2LyZO5F82hjoqfF26aZOQLjf7HypltE1BdcdRjpRLBgugZ71blD/IOC WMuQ== 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=BdeU7FfKwiGi/AO6tNTipfQefeEkSZ3wHSQTJcdsxWg=; b=Wtf7f1CX3OAgFXvl+L+83bV2qg0PTcYdCyeJyoRP2b2t4dWJZS+BQ4dAnMg1u4ya3B 5tHiQYXKn2wthQu5X28/OT8vUvMOYYQ+WPXSSprdacYL6Z9Oks+Nmey/11L98YO9Wz+i oRb1sT8G0/gqVC0T4xXcvAkjIjVZvzMv1Js1WQrYS0QywBkdHMNGKOXGLKr9QnXWwlri WsxjI1ZfVtTwk87jssTDF5t8sflDjLNXdd5RE/J1LGY0uxlL1x4o3y4kTIYLHHz+Nm11 G16U+AKQIQBKRGfC37cBRQuSWHmaqGoKKS3X2sYporFHJ7HU/xmMckKJ4FzrQH//Iaef ussA== X-Gm-Message-State: ABUngve05JGGyQGkwQTnQ0q8fcB2MVK0EKYzUsR7l6G6vHcUyl+wM4otWozhNNbF6kDlyw== X-Received: by 10.107.165.149 with SMTP id o143mr8738153ioe.21.1478938445691; Sat, 12 Nov 2016 00:14:05 -0800 (PST) Received: from localhost.localdomain.localdomain ([104.192.110.250]) by smtp.gmail.com with ESMTPSA id i72sm5396900iod.19.2016.11.12.00.14.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 12 Nov 2016 00:14:05 -0800 (PST) Message-ID: <5826cf4d.4b866b0a.caff8.66a8@mx.google.com> X-Google-Original-Message-ID: <1478938436-4310-1-git-send-email-Qiang(liqiang6-s@360.cn)> From: Li Qiang X-Google-Original-From: Li Qiang(liqiang6-s@360.cn) To: groug@kaod.org, qemu-devel@nongnu.org Date: Sat, 12 Nov 2016 00:13:56 -0800 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::243 Subject: [Qemu-devel] [PATCH] 9pfs: free the private data memory 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 When the 9pfs use 'handle'/'proxy' as the backend driver it will allocate a private data memory. But this memory is not freed in the unrealize function thus leading a memory leak issue. This patch avoid this. Signed-off-by: Li Qiang --- hw/9pfs/9p.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/9pfs/9p.c b/hw/9pfs/9p.c index aea7e9d..6524b13 100644 --- a/hw/9pfs/9p.c +++ b/hw/9pfs/9p.c @@ -3532,6 +3532,7 @@ void v9fs_device_unrealize_common(V9fsState *s, Error **errp) { g_free(s->ctx.fs_root); g_free(s->tag); + g_free(s->ctx.private); } typedef struct VirtfsCoResetData {