From nobody Thu Nov 28 09:41:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=outlook.com); dmarc=pass(p=none dis=none) header.from=outlook.com ARC-Seal: i=2; a=rsa-sha256; t=1692930843; cv=pass; d=zohomail.com; s=zohoarc; b=J+RU+U9JpAms1CGw3DInzb9rUHINiMEQ+SvAcqaH5ejD0PoM6Aau79lJ3RnguGFEftYKmSE+IjU4sKLuBLnJEQ00cOZbhXluXNZZGClYwySTCuzO3dSkL5Asmk4/4xWafhVi0m6C3vgSR0iO2z6CaE3QyAhezM292evyBcbysEA= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692930843; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7+8SZMnIWVynuduy4NTpdNCFWUxetALixt7hCAfwXH4=; b=f9DIKwVLJSz9wBTOLmGmyLxe5aTLkt1/DV0qoZR3T0SLi1OpxsSKzvp0Dh9tgx0+E0y4x+/t2solAYsziJlwELyCK1BIaKuqw5tA4ZL6X8avxv6lgEqTG5+1QesACPHhBFBMjI/9r9W8MNMux2xjroroSu6aDVeDza6jh5wyZEQ= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=outlook.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692930843084428.3068738278246; Thu, 24 Aug 2023 19:34:03 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZMdP-0001Dt-AI; Thu, 24 Aug 2023 22:33:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZMdN-0001De-DK for qemu-devel@nongnu.org; Thu, 24 Aug 2023 22:33:13 -0400 Received: from mail-mw2nam12olkn20817.outbound.protection.outlook.com ([2a01:111:f400:fe5a::817] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZMdL-0001X6-6y for qemu-devel@nongnu.org; Thu, 24 Aug 2023 22:33:13 -0400 Received: from SA1PR11MB6760.namprd11.prod.outlook.com (2603:10b6:806:25f::14) by SJ2PR11MB8449.namprd11.prod.outlook.com (2603:10b6:a03:56f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Fri, 25 Aug 2023 02:32:34 +0000 Received: from SA1PR11MB6760.namprd11.prod.outlook.com ([fe80::df85:2db:d56b:38bf]) by SA1PR11MB6760.namprd11.prod.outlook.com ([fe80::df85:2db:d56b:38bf%5]) with mapi id 15.20.6699.027; Fri, 25 Aug 2023 02:32:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ole/bw7N/zkgqF97WLKUwnNMH5T30iAET55f2MZNmbAdqGWRtM/DBR9D7u6STNWjB7rmb5l/6F2SDlIlNU6skhSdJ0uX1Iz/pfitP1TIVJXVO4iqrqEaRhn0DGOEbmJxPXTH+ivZbORcyletRV1EDv23wzU+R9Dz57vq9vZcWw5u9qsGcIk8Vk4ymjKeKFq5JtVJeYinua1eJXO2bOA/afPx8G4KZpBN4m02GU2goYNFlE59P3ZpmEU2jfNxERImxcxzd5K9y9acqGHXqVYW+JxN42R5CEpCrLjmPuClQoKMv2jSzi3QUNHWpxxq5hiL04EAu4bGgDcC4MtqffZlCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=7+8SZMnIWVynuduy4NTpdNCFWUxetALixt7hCAfwXH4=; b=H848wte8efeASZCS1vVzImj/OJ+fUn/NabCRC5K5Z+XOWW7wEFFJzcxjFDTUdajig3ay3cyCDorskmsnieh6ai0eyA8S7usnEb0efakxxcj3xT9+aMW2zmO4mqtsrbmokCQTdi89drOihZBS4dZk7vhupfSAuTQAak9EOF5Jyky+cpptheMVNPdDhD+/t8J4ebQHwBinv9bG5Fv+CGu1sE5u0CyF4aXKsE3kfHZeZQoVt7rymwPaZikIs3nNHeigWnKGGWE7cc8UU9z6CsHiq20TqMwD5maSav0dRJuoSdCt4Px9STKhyIgHNMrQ+uwpgAxtLruXlCcRP9s5LY+UUA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7+8SZMnIWVynuduy4NTpdNCFWUxetALixt7hCAfwXH4=; b=BzzAhkta1ypht5Pr6Par/u18ez3xkGWtiT8u0gTUEHHhQWceJTjnZXe7r4VT5FFqOmQoKzbEVxERFuCoerH1wEVzGWm95P31hDkGosmbHuNYRLbB2LZT5gpxpvmuPt7jvS1xFfwE8EZy59IAWxcQb4GmCvjw/Pm7atBeD9xsMqkeghBaYpcnwmzmcmGcCCblbmPWtL85smYYI9gJGVyoC8jNQIFOgBLRjrWPhd/DlGkNZS0nbY8V5etrt0RDwuZ6lPP97Oi8RZozdH1zwYRuiLRzzK98CfBYb3C21aij8eOgpEaW9nMbukmBBLtMeRtU0TMkt/BXgSzWKHZk2+oXxA== From: alloc.young@outlook.com To: yong.huang@smartx.com Cc: mjt@tls.msk.ru, qemu-devel@nongnu.org, "alloc.young" Subject: [PATCH v2 1/2] softmmu: Fix dirtylimit memory leak Date: Fri, 25 Aug 2023 10:31:20 +0800 Message-ID: X-Mailer: git-send-email 2.39.3 In-Reply-To: References: Content-Transfer-Encoding: quoted-printable X-TMN: [BugqierZPbBCfGHXsIptqA2KDNEWoivvGo3e83nWrXk=] X-ClientProxiedBy: SI2P153CA0033.APCP153.PROD.OUTLOOK.COM (2603:1096:4:190::21) To SA1PR11MB6760.namprd11.prod.outlook.com (2603:10b6:806:25f::14) X-Microsoft-Original-Message-ID: <2e796c56b3ec535817ded15577e9e0077c20f6aa.1692925847.git.alloc.young@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR11MB6760:EE_|SJ2PR11MB8449:EE_ X-MS-Office365-Filtering-Correlation-Id: f16f2d38-a7db-4932-649a-08dba51389e9 X-MS-Exchange-SLBlob-MailProps: ScCmN3RHayGFyzKqG2j+JWu7TdfJHtreszRPvNKDxsAQXCPywoArShX/ID2wnzbypwrIbm46+wvhNanMGBRELyzisZ+hBQ2CvFhw9f1pQqD3kN6eiC5pTaClCBdoTFBDDZqtrHQ3uB3Wua9vHu9kzQkw2qoqlILfqulWdh1k/0bRjwGUwxozLPPQ+EGMVHnYD1Yzbbl8T8UMPzqtrF4I9reIqealgXEdh8wjgu7nCN5PMYRMHF2SUeqNMZdCQIbZjPCOcpLPufTmX6QcUc6g3vHrQMR4cUKIE0UEiWA+xpit0xNVcYC+MCoLdD0/Rbuz6EJcz5g6BbygeqlSEWnvwsuU3hZorG8Jc4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AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?GY0Y4hI4/PsELA7DbwCrrQhDrOsNw1HkuASGKTvuaGc26qTw5kYRMX5TDWPr?= =?us-ascii?Q?QxS/UXWCJZqPMiYffOS+z8wZAKGqzAPDWwvd/TDTuBPwP3SczGdxhgfAyXkx?= =?us-ascii?Q?V06xykJhQ5s91t7LUK8hncC77OLghVPXnEl1YXsLyVRhykTOYcW4kjB52TAp?= =?us-ascii?Q?6BCDEeOzthCk6ozb496PSaLvmGRa2oHK0UWrTiQt0V0jsa0Br2S+wIRIlWfC?= =?us-ascii?Q?1uWynCn0rpQY10vyUli7JZ6mzhK5wxl22Il/R5/3BFZcifibHw1wYkhL+08N?= =?us-ascii?Q?NMrvbJnZo1EjEFx4jg4HC0zmJSQAyWVBd3Qbe6wgvXvjn17wPQ0j4EBL8z7k?= =?us-ascii?Q?DRd7swsh53XvoP3dPLLbJA34bndbru7M2pi36gMaTNNFryEsvbxRz1YjDt5k?= =?us-ascii?Q?wmROLWw2T+ufZZAitKpCJZdfVfoC23rpGc5txF5TzFJxbLzLtMEygMknM96g?= =?us-ascii?Q?C6mQ9RBdzpqEZUfMiMbEmMmFEgW7w/f0dn2ZGHjk9YyQVy8n1cSy0BNBIjTc?= =?us-ascii?Q?IoIrPIaYIOPiC4xWuUZTTD1PEKe+mLM2y7zngxOyMobHybNwMWL1yiR0sc7J?= =?us-ascii?Q?glwbfdAaE3Ksu3+lZ/Ei9YJ8G0FEdRhy7zoq5UVoDUuwV3ueY78aDHvvAh7j?= =?us-ascii?Q?+exIFtiVNyUCif86RC7fKfcEjqOJ0cBQs70UzUvZVxMWtKL97v8UnFhECez5?= =?us-ascii?Q?FPyD/S/RBDsDMeMBDJb3SPmlm3ndec48oM9UwqaRTonP9HSDwozjBqJvCgDg?= =?us-ascii?Q?GJaFTOCZtd/8rdadx4dmrF3tbnRVPyIxf+7NAtuoc104HyMa9NIevNTm60me?= =?us-ascii?Q?WKmktgrK/LrHOgDwhK7AeBlOjZaa8+oOAltE12NTML5ENa8lZct4BTzOH4Ik?= =?us-ascii?Q?c6Pf4QsWHrqaOxSzUwtscRx6V30SnDEQ/4K5in0l5PeuWxkITWpo+YactCCj?= =?us-ascii?Q?O7K6QDQ58lFRDKs3z88nf6z2IgJaRqPrplQcjwMpBivYKyMArH256JXD70mu?= =?us-ascii?Q?SaDI5a0XrRVqtfB+Cr5GpokaxvD/kmO3tedDNYkz/i+3GzlQ6trzn9U9ucp3?= =?us-ascii?Q?h38tj21yo7FaaXp34L2SZO2iv3g/7F5gBRwE4LrOx4LiGbw3//BBAYniI3YC?= =?us-ascii?Q?vZVCdgLu79YNoSYJ+CRwtkZt5I8LQLEIf6FC1n8qsKBATROwDLeITp0i/a6b?= =?us-ascii?Q?YmN+sbovqIq+YnK9EVieFSV35S/zXOwUWzcw9foARWyHudTRIC98S72pYJs?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f16f2d38-a7db-4932-649a-08dba51389e9 X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6760.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2023 02:32:34.3274 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8449 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a01:111:f400:fe5a::817; envelope-from=alloc.young@outlook.com; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @outlook.com) X-ZM-MESSAGEID: 1692930844862100003 Content-Type: text/plain; charset="utf-8" From: "alloc.young" Fix memory leak in hmp_info_vcpu_dirty_limit,use g_autoptr to handle memory deallocation. Signed-off-by: alloc.young --- softmmu/dirtylimit.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c index 3c275ee55b..e3ff53b8fc 100644 --- a/softmmu/dirtylimit.c +++ b/softmmu/dirtylimit.c @@ -653,7 +653,8 @@ struct DirtyLimitInfoList *qmp_query_vcpu_dirty_limit(E= rror **errp) =20 void hmp_info_vcpu_dirty_limit(Monitor *mon, const QDict *qdict) { - DirtyLimitInfoList *limit, *head, *info =3D NULL; + DirtyLimitInfoList *info; + g_autoptr(DirtyLimitInfoList) head =3D NULL; Error *err =3D NULL; =20 if (!dirtylimit_in_service()) { @@ -661,20 +662,17 @@ void hmp_info_vcpu_dirty_limit(Monitor *mon, const QD= ict *qdict) return; } =20 - info =3D qmp_query_vcpu_dirty_limit(&err); + head =3D qmp_query_vcpu_dirty_limit(&err); if (err) { hmp_handle_error(mon, err); return; } =20 - head =3D info; - for (limit =3D head; limit !=3D NULL; limit =3D limit->next) { + for (info =3D head; info !=3D NULL; info =3D info->next) { monitor_printf(mon, "vcpu[%"PRIi64"], limit rate %"PRIi64 " (MB/s)= ," " current rate %"PRIi64 " (MB/s)\n", - limit->value->cpu_index, - limit->value->limit_rate, - limit->value->current_rate); + info->value->cpu_index, + info->value->limit_rate, + info->value->current_rate); } - - g_free(info); } --=20 2.39.3 From nobody Thu Nov 28 09:41:10 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=outlook.com); dmarc=pass(p=none dis=none) header.from=outlook.com ARC-Seal: i=2; a=rsa-sha256; t=1692930870; cv=pass; d=zohomail.com; s=zohoarc; b=c3KVDEtR5z7W64Py3g07CvmFEi5pqmCy36+qX2QL1lJgrDz6zBUqO4qUtuI6SDx7536EDtsknlPv9W/Y9VG8tVX8/2eeRBkb5TOLKN+d3PEo7hLXqHeGvJy/x5L9MTEswp7PE5PGo6boE6Y6LaMsVxDqPT0vn9s56sbd89HDi9k= ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1692930870; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uSfmnLunuA9AjVDvHjybVAS8mdwyvHyBlM/JEI4Jyy8=; b=oKq/3gZ7cgivuWPXSEX46KBFAimmzu/aoU4QKnn6Y2XWxt7LL3ttJAiJI3K4PwfDcPvySEVQYEMMqIqHsqULzjPsnWPqkQie698K679tcnsJedhbsCNbU0U6KcLyh9BsyoBAVVoPWZydOaBvngMNhXLSvE5vnd44HMzJP+5bliE= ARC-Authentication-Results: i=2; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; arc=pass (i=1 dmarc=pass fromdomain=outlook.com); dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1692930870338488.83168734139986; Thu, 24 Aug 2023 19:34:30 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZMeS-0001nn-5j; Thu, 24 Aug 2023 22:34:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZMeR-0001nB-1m for qemu-devel@nongnu.org; Thu, 24 Aug 2023 22:34:19 -0400 Received: from mail-mw2nam12olkn20823.outbound.protection.outlook.com ([2a01:111:f400:fe5a::823] helo=NAM12-MW2-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZMeO-0001aU-KO for qemu-devel@nongnu.org; Thu, 24 Aug 2023 22:34:18 -0400 Received: from SA1PR11MB6760.namprd11.prod.outlook.com (2603:10b6:806:25f::14) by SJ2PR11MB8449.namprd11.prod.outlook.com (2603:10b6:a03:56f::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.27; Fri, 25 Aug 2023 02:33:41 +0000 Received: from SA1PR11MB6760.namprd11.prod.outlook.com ([fe80::df85:2db:d56b:38bf]) by SA1PR11MB6760.namprd11.prod.outlook.com ([fe80::df85:2db:d56b:38bf%5]) with mapi id 15.20.6699.027; Fri, 25 Aug 2023 02:33:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=g1qylwzI84ImAVZapYYRlnlMWiarNu+bPZYvyAc4Dy4pDS3enkd5vroNZZutvqyxFLCV+sYwjG7SNgyCOASTjG9ZvG8jTFMFo/2CSws96fEJtgMHMIbZYqXCbGYjl0fIHSKSgbi1Aq1heofFDRH4mhBis4NW6qENScR/zhc/z8f9zPPSgmnTwOlnzZcezXI3e2FHwGPqcCsuHC8AvuclspZvoWX0fQSkOJM92VRIK5tBNIiiO7myaD/AsZ3g7MsWARZ/A3jtuk30qfh2pDMsvcwfjPbnXJRCEJr8/AtG+xIoZbp6hQJS2V3NVVAHyQO2jam9YuAt6xlM4jSaiM6Yfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=uSfmnLunuA9AjVDvHjybVAS8mdwyvHyBlM/JEI4Jyy8=; b=ZaGxe7S2gFpSefNhpoBtSx9yt1iaFSpsNkZSxLPmspmU3PEqAXj/XhnPaBYMyaFCxx0QUhfaiIkSbCcI0m3qhsueTEzbU7Tyco3RUQ4rj+UKHCLbH1PPDrsNt72lMft/m/ZO4bDWnZ9krq6NNZK/MV2j6vBI2oF2wfB6k4qS9x1/K1xw8w+nn8SH88s322gTnpMDKF+DGnuDrn8wFdKiSQ2bMugJx5H7iMj1DuGKjXoFtPT4qgTGB0DIvrdcKyA/SYfpbrmzv/ThJx4tofjK3LK2CuDY/Ybhhhi/oL8zfb+HxduLh/Tc42hx0JDQFySG96l7tmaqnET0k72Ij1XIQA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uSfmnLunuA9AjVDvHjybVAS8mdwyvHyBlM/JEI4Jyy8=; b=k1C8y7KgBCC4qWsa6moSA4XFTVf/YuMSuPx/+itW//eJ4iJLshhpPY0yUcxQCJYhcINNMHR6u0Tv5h7ugWXee5iR1QE6LcvttCEIB39fD/HHaXtZQ+7ZK1eDShX0qFaLcAWA6D+TYTX31F/AMQjaeKmi9IHozrana9rB6XeS9nGGgzGRDRBrdSN1wu1eNyAWGqVHaZPZCvA1E4zvQn9ErxCpgYriK/Zm8W6J5Jz+QPp4YNuR0RETMp94yZJaD9YbaqgsYsNRDsLbTXAxwGxmvTA6nOwHTF9XNLyNcwPWH6k5Hr4Gwduf9sO9Io8BPPk+8VXo22hGHH1TINphGFl5tg== From: alloc.young@outlook.com To: yong.huang@smartx.com Cc: mjt@tls.msk.ru, qemu-devel@nongnu.org, alloc Subject: [PATCH v2 2/2] softmmu/dirtylimit: Convert free to g_free Date: Fri, 25 Aug 2023 10:32:51 +0800 Message-ID: X-Mailer: git-send-email 2.39.3 In-Reply-To: References: Content-Transfer-Encoding: quoted-printable X-TMN: [1GTWlVuUzMQ57fRBCYVY+Q1yPkq9Q2bIUm/D6H1dYkA=] X-ClientProxiedBy: TY1PR01CA0189.jpnprd01.prod.outlook.com (2603:1096:403::19) To SA1PR11MB6760.namprd11.prod.outlook.com (2603:10b6:806:25f::14) X-Microsoft-Original-Message-ID: <4ea87d7b8c4565f36b6d27ad83ae8e042796f1c5.1692925847.git.alloc.young@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA1PR11MB6760:EE_|SJ2PR11MB8449:EE_ X-MS-Office365-Filtering-Correlation-Id: 956cabdd-d9bb-40cc-3486-08dba513b22f X-MS-Exchange-SLBlob-MailProps: ScCmN3RHayEad0gv6pJaltsDtbd6NSVllMnjD0YIkdXJeo1MVtAQQhVoivno3uKqu2hVwGhI/835mixNDAl8ZMf2kC8FvPLFQP9yj8YPyc8aEHv+L7Dh++gHrueuIHLtLBUj3J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O06yXrmkbaxBGUwjRPfpvjNKWxjOm/I2AzfTLUb1Aib+7JbFb2YDZOCogOchVyM3Gp3b2R7okDWunM3LEM1SWqXag37nphgcTQJwvPQ1S8nyD0Z3A8CuXwwRSRV9rnnnVLMu5bEBzOyv57VW6zuXEwi5qFfuOO0abk1Oc0ENqCa3HkKl4sV4rAcHytFsKQQHlRu1P2YfTXvZS5ZxmvABYW X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?qWFQForDixOKHNCwMJVmp9dHhcq5GRQhBwN4Mip3lePWW9mmZcIiP9+meFC0?= =?us-ascii?Q?ZOvq/R04AhlGL6IB7kX9M/BkxTnoHval9h/xDqvGOY2VI2IC1uLXP5Kl7+vk?= =?us-ascii?Q?kHMDS6Z9pU7Ybs/ka0qJKZdVlQIsQvYk2Ey50QyoR+sJtSCyDgvLyBpbKx9I?= =?us-ascii?Q?XV8udpMvTxjVtCjro38F+FfYvpX9axK2p4QgtUfRjAa7/+ZUieFNVDdovAE/?= =?us-ascii?Q?3MNb4RlvQuOvwhj8S3wO9btGpTsodDXi95VL3knMP5bZQeaO/xLEBsZnyqfy?= =?us-ascii?Q?56hJLRNZYiEMMZfMtLnTHmMEPrLgT8krjlbxlHmb+mKyzKUqm8m2ArzYMC21?= =?us-ascii?Q?iTqiLhp1g5sDam/lY3saxjbH6orCXeoZeWv+UZ9GuDIXCjZtjIsqi9as4f99?= =?us-ascii?Q?DgOSO0OjPP7c1/wTbmy/I+MIi5BGkdxasoNkMF+8QS1jmjjSvD187lUOhUdO?= =?us-ascii?Q?QDs/hKmR8ivNmWK/9x8683F9FJ36chJO6W/yx9SzMJeTOlrchEijyzwZ87DF?= =?us-ascii?Q?Eet8DbyHRhA1OHrol+r6obbWKp5bxhy90xkgLn8Y5xfB4D5yxzqTq++U186s?= =?us-ascii?Q?VgyXedEsdieSgFz9Lf9hHOxVm1KrVrYPqtKMPYREa512V2wT6hFcJ76T2Kyp?= =?us-ascii?Q?nsK5NhNDqM6lXLIYapyhMfTQ0pUvP3pgzOQCNZpCc4Z1gcNbWIfsH9CiMnCO?= =?us-ascii?Q?e95krw0zZwCgYOVCFvGIl2kSE3XWEMpk+kGshhl8R59L37XBpuXCt9A1wNVZ?= =?us-ascii?Q?uWgf6b3tq+VKs5hMcIK1/zu9tuIKE+V5k/G4DerfogexY8BTRSDiZkyH5XWw?= =?us-ascii?Q?g3j7hEX5QaNZSehKDC2+PHtfc8u099fifNRYnVWogePUpmwK+H52g1TOr5xG?= =?us-ascii?Q?Nz8Nr990VvodqyeJ3NJIh602xPBL1O/YmL/YaIldKw2bRdhtY0XUTVfYKrLQ?= =?us-ascii?Q?j/nHnWDpBuS8U1HF7gcVVXr+tK+guUZqAimVIPRLLQDYEVzh9uQGNeYcw3Rs?= =?us-ascii?Q?5xgHuVcfoBzIyUGBBwQumXy10JvAARoho1TwEH3Fhl8aj81kR1Q+CABAuDGf?= =?us-ascii?Q?+wNobAFhF2s7IkbPuPiQoH+0uegW/gsavPZnLj4u41gn1Y+Gh96cBVeuVWEd?= =?us-ascii?Q?aLE/SpdWoFwT9Moqs1PzUlvjaEwvfzbFlkmcbbOQ/Z/ZNImM1RsoSa4DTaLN?= =?us-ascii?Q?1uwTpfmDfM9jAqzHQX+4JDpS8JRCwMsCcIGiNoOjSn2YqSNKOQN/fN2La5w?= =?us-ascii?Q?=3D?= X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 956cabdd-d9bb-40cc-3486-08dba513b22f X-MS-Exchange-CrossTenant-AuthSource: SA1PR11MB6760.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2023 02:33:41.8316 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ2PR11MB8449 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a01:111:f400:fe5a::823; envelope-from=alloc.young@outlook.com; helo=NAM12-MW2-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @outlook.com) X-ZM-MESSAGEID: 1692930871997100003 Content-Type: text/plain; charset="utf-8" From: alloc Convert free to g_free to match g_new and g_malloc functions. Signed-off-by: alloc Reviewed-by: Hyman Huang Reviewed-by: Philippe Mathieu-Daud=C3=A9 --- softmmu/dirtylimit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/softmmu/dirtylimit.c b/softmmu/dirtylimit.c index e3ff53b8fc..fa959d7743 100644 --- a/softmmu/dirtylimit.c +++ b/softmmu/dirtylimit.c @@ -100,7 +100,7 @@ static void vcpu_dirty_rate_stat_collect(void) stat.rates[i].dirty_rate; } =20 - free(stat.rates); + g_free(stat.rates); } =20 static void *vcpu_dirty_rate_stat_thread(void *opaque) @@ -171,10 +171,10 @@ void vcpu_dirty_rate_stat_initialize(void) =20 void vcpu_dirty_rate_stat_finalize(void) { - free(vcpu_dirty_rate_stat->stat.rates); + g_free(vcpu_dirty_rate_stat->stat.rates); vcpu_dirty_rate_stat->stat.rates =3D NULL; =20 - free(vcpu_dirty_rate_stat); + g_free(vcpu_dirty_rate_stat); vcpu_dirty_rate_stat =3D NULL; } =20 @@ -220,10 +220,10 @@ void dirtylimit_state_initialize(void) =20 void dirtylimit_state_finalize(void) { - free(dirtylimit_state->states); + g_free(dirtylimit_state->states); dirtylimit_state->states =3D NULL; =20 - free(dirtylimit_state); + g_free(dirtylimit_state); dirtylimit_state =3D NULL; =20 trace_dirtylimit_state_finalize(); --=20 2.39.3