From nobody Wed Nov 27 04:31:18 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; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1701105003; cv=none; d=zohomail.com; s=zohoarc; b=hh8Cd7CEAsUERnO7OFk8wVCwLKb2v0NHQbsavPnDmXxMgEJps99SoQaTsnFkKoykB82z/6i6tTPM+LoiGsTdjnY4ZLvrWa7zxdSDSg3PvKr2rA3O3A6jgraIvEeqTgYwFq7RvEWpFC7Dm8pb4VfpE57aYSHHTTIkSkjVHSKlUtI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1701105003; h=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To:Cc; bh=z25o5HgpS769sk9FWaELdrm182ytGgUoPKT3/jaRyEU=; b=BitMYXIoiCNm/OmszQdZo29w5htl3nh4urSZGLMVQULxDrQEd21wqAlQYdY8iybMQR7Vwc2tm2tYOZZ+yLX1HomvXFnGXJI1z0TpR1xcaHoqJcY9und9gEopgVFPa2sRtih7n40kRDBtwz/A21smY9bzSalmM3MJE4OkLUTeY8I= ARC-Authentication-Results: i=1; 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; 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 1701105003304219.65961173326912; Mon, 27 Nov 2023 09:10:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r7f68-0007Tx-Iv; Mon, 27 Nov 2023 12:08:40 -0500 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 1r7f62-0007Rp-Rm for qemu-devel@nongnu.org; Mon, 27 Nov 2023 12:08:34 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r7f5z-0004dH-JH for qemu-devel@nongnu.org; Mon, 27 Nov 2023 12:08:33 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40b4a8db314so155445e9.3 for ; Mon, 27 Nov 2023 09:08:31 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fl8-20020a05600c0b8800b004030e8ff964sm15353216wmb.34.2023.11.27.09.08.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 09:08:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701104910; x=1701709710; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=z25o5HgpS769sk9FWaELdrm182ytGgUoPKT3/jaRyEU=; b=ZUBOqEcgtMjks5jLUb0ovvKTTXJQiIdSpspkVlepP2SMxSua04ytRYArzHCk+f0XjL DpOuEWVTyPfFJL4o282mA2iaBQEfxw0cy4bqd5s8v6yC8l7AFWtXQGsWo2asJGceuhkK Fa/xyK1YnayrWDZOaQ8vcX/DI0SnHlmdJN1yeCnxjaJOHrPNk87HoAC2g4Q2R+bkEszm JFQbMVyHXM2m11NtsBIAG+ai6WMjBD9ed7hATA7SGjso03ph6+our+pMP+0oHQn8C3Xp qWNvSR8evwKLi2vxOQcKjsEWSLlgBr3x4T9BPk8GEu3FPsokxe5gu4fosm4lV+QkRWk+ n5tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701104910; x=1701709710; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z25o5HgpS769sk9FWaELdrm182ytGgUoPKT3/jaRyEU=; b=nbvwGfNK50HyRE4dpkxDwO5rh01L8JR5cZhnlqgSMjB+9xHx/sFQVX5jzK0WN/QAGA JfDLlMrTHEF8JKb3575zHirKXerq6T7fvrw4fbAEJBQIsoRIA19kmEvUFSGoYweXXdaJ qcOQOM7b95TTb2Hvn/PNX5KmKrJxWTkeasuQ4lpkg0TmacQT3Zb7whDsjTnR+0wGl0W8 EpuCqjvRDBwTshowE5wGOfl9yS5QAkn7nZ7vqlMfC3QnkTFZ5O7NXx9+bW9vnYp3yzQX ku1o22KhF3chwc2obP8AKy1Tow9IQqRMyQxsluWnX9ZOyTKVOG+642Qhkou8msXk5k3r Y8FQ== X-Gm-Message-State: AOJu0YyrRIgDLGsWt10c6dVGZsPhZymmteXPTbGyCeIZquRSGrSeMV8G Sdvm2BzbJSdXsvKbBhYTVDkIeR7EqJUV9r5rTT8= X-Google-Smtp-Source: AGHT+IGuHifjooqi6K+dZu14L9z0TaDUyYIvYXdWTYrTdss6jC5rPP2/EKCkQV3ILVKTkJ2XWe4CaA== X-Received: by 2002:a05:600c:4ed0:b0:40b:2b86:c886 with SMTP id g16-20020a05600c4ed000b0040b2b86c886mr5335928wmq.31.1701104909856; Mon, 27 Nov 2023 09:08:29 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 07/13] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize() Date: Mon, 27 Nov 2023 17:08:17 +0000 Message-Id: <20231127170823.589863-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231127170823.589863-1-peter.maydell@linaro.org> References: <20231127170823.589863-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable 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=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 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 @linaro.org) X-ZM-MESSAGEID: 1701105004255000003 From: Philippe Mathieu-Daud=C3=A9 Commit 0be6bfac62 ("qdev: Implement variable length array properties") added the DEFINE_PROP_ARRAY() macro with the following comment: * It is the responsibility of the device deinit code to free the * @_arrayfield memory. Commit 4fb013afcc added: DEFINE_PROP_ARRAY("oscclk", MPS2SCC, num_oscclk, oscclk_reset, qdev_prop_uint32, uint32_t), but forgot to free the 'oscclk_reset' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 4fb013afcc ("hw/misc/mps2-scc: Support configurable number of OSCCLK= values") # v6.0.0+ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Message-id: 20231121174051.63038-4-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- hw/misc/mps2-scc.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/misc/mps2-scc.c b/hw/misc/mps2-scc.c index b3b42a792cd..fe5034db140 100644 --- a/hw/misc/mps2-scc.c +++ b/hw/misc/mps2-scc.c @@ -329,6 +329,13 @@ static void mps2_scc_realize(DeviceState *dev, Error *= *errp) s->oscclk =3D g_new0(uint32_t, s->num_oscclk); } =20 +static void mps2_scc_finalize(Object *obj) +{ + MPS2SCC *s =3D MPS2_SCC(obj); + + g_free(s->oscclk_reset); +} + static const VMStateDescription mps2_scc_vmstate =3D { .name =3D "mps2-scc", .version_id =3D 3, @@ -385,6 +392,7 @@ static const TypeInfo mps2_scc_info =3D { .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(MPS2SCC), .instance_init =3D mps2_scc_init, + .instance_finalize =3D mps2_scc_finalize, .class_init =3D mps2_scc_class_init, }; =20 --=20 2.34.1