From patchwork Tue Nov 21 17:40:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 745723 Delivered-To: patch@linaro.org Received: by 2002:a5d:5052:0:b0:32d:baff:b0ca with SMTP id h18csp2014228wrt; Tue, 21 Nov 2023 09:42:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2Bv5x9t+OI9OcQxaBPeFxC5A/0q7sHERh6Q0lKDU/WJwsdldDgccRPCNCQMQ9fTJbrilt X-Received: by 2002:a05:6102:2753:b0:462:a059:4c8e with SMTP id p19-20020a056102275300b00462a0594c8emr7347931vsu.18.1700588552042; Tue, 21 Nov 2023 09:42:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700588552; cv=none; d=google.com; s=arc-20160816; b=DexRc6jkrs30Lm1yKWFZ5CM94vM/wIKm7+TDdCvP/LLteE/1VwhEkZB2Yn2zSjVxXM 3WGBg2+1zSli1bUIIlR3Z+McAVofvSs1Bf6y9CLsYPBz4CokRGQJBLhvTfo0VYWp/sbH BFL2x9SZ5mbZFaKQdfToKchBvKGjbAezPdaOggkPTBoP4igZ99stbeSf4m1C60xnoiqM qGUZO/u6HeMbO5t1pPo5IEUrDJu5YN/EERBBZKQAj4XT+oXO80J59Bqdh060WKd04BYJ 838sfjnPokVvZJqyhQ+WECa53YKWdXWV7bTApwpoPXl3JYHmkqO/sejvIpftZHjjrYcc FgmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iW4GbGx1UKeBuWo5IN5MHnetcyTDNo6L05KNntf8yQU=; fh=cL0kZojwLp2/+GG3A9WvbPyWHrvsxnhr8acLawhZl1M=; b=khXARFcJD6O+2YKTtchYewLo3+vp63fIUxm/AA1AFn4HGp9HBHFUm7OZjKZ69CBf2i GH/jrImjJLyI0IJRl3NkZDZlMEx75ckNsATV48yhTRMC6CNHKLfp8kc1ijKXYSgZLksL wTPJs7FiMvIJ758NFpz718QRZuMUGAsuC/CJr1kC9yRO1AE1iUA+aJtsJTdspWJXClAb x6NOb0/i0RtXvWYZRHWwC5DpTf9p9QXIlPenw5hyhB//z+tKeZZKl+fGTCCYLHkaTZiS fuz2+v29Ru1mm7fduQLri4JVuDr+ujS136UjOBSN3naqiUsiU8Th+KLQMCshr+Pt7wfA KFug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NWy8vfgf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id ho6-20020a056102396600b00462770c0b10si2360275vsb.204.2023.11.21.09.42.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Nov 2023 09:42:32 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NWy8vfgf; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5Uka-0008Pl-Qh; Tue, 21 Nov 2023 12:41:28 -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 1r5UkY-0008NQ-Tf for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:26 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5UkW-0001Jc-En for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:26 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40a4848c6e1so24118945e9.1 for ; Tue, 21 Nov 2023 09:41:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588482; x=1701193282; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iW4GbGx1UKeBuWo5IN5MHnetcyTDNo6L05KNntf8yQU=; b=NWy8vfgfZBsG0J+ip2DRxRSYOMiWo0btr/4KWGjGCod4LqmqvAdoLFPuQLCGt1KJyH LR+qo6ItxhRGYxz4FOdgHOhAYTC+KsB65DwFaoQIQtOWwQLWL9wF++OtRQbnN/3x9lJG a7hssCJSxeUoZsneG38NkkM4aVweoln6GMoe3zF3EeACmProssnz2SKUGLIZRkVm7KYo msp+Rc6U8bHSzbhD15WpwWwmKCHWLKPUKsUsAKhRbl0Kepsx31oDPUHdICT/XH/9jbKt fAKKCkMaNf0WuilBnMqK/TKIOkqAOXHrpIp6VEiMdsleX0o+924SMI7bVrZaRhDUtByd np9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588482; x=1701193282; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iW4GbGx1UKeBuWo5IN5MHnetcyTDNo6L05KNntf8yQU=; b=wj/9LsiQk4rpuKcV2fGj8o0Ny6lo7ShpmVsLf0e2l32t6F4gh/lXU5p93jxuO/IGwl Wips1KH/BAvqSjc1EXzXefh+NWxQU2SPBEsWYxMxEXjUOXsM6qI0phUwF7xAwelpIqnU 8okMplpC9D1BsD5UR2MIaCCZUaq5jjC+/EWXIKYncQI6kK+9x/F3d42Wi59YR3nZdffT 5nk8K1Gn+9xoxYr7WLpIYWuWWyzR++sPUu+orVgRRAFhkD94+0UldCXDNKuTJNsB5qGy 83SI+dyVghV6DzsvH72KVvi3qjRy+SFuCKunj+LrvWK7N+F6nIsjVgDAsVkPbAXJ8Ewp 2dNA== X-Gm-Message-State: AOJu0Ywy7Ziryv+NGHomQisvvSpXatmtLazW8vt+GtYxJUyndzMS/hCP 59DZ+pdmeSbtxXDd1fS6bUXbQ2GCJv9kc+drdLs= X-Received: by 2002:a05:600c:5127:b0:409:79cb:1df6 with SMTP id o39-20020a05600c512700b0040979cb1df6mr44139wms.14.1700588482749; Tue, 21 Nov 2023 09:41:22 -0800 (PST) Received: from m1x-phil.lan (lgp44-h02-176-184-8-219.dsl.sta.abo.bbox.fr. [176.184.8.219]) by smtp.gmail.com with ESMTPSA id u3-20020a05600c00c300b0040648217f4fsm21512532wmm.39.2023.11.21.09.41.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:41:22 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, Peter Maydell , Alistair Francis , Kevin Wolf , "Edgar E. Iglesias" , Eric Auger , "Michael S. Tsirkin" , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH-for-8.2? 5/6] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array Date: Tue, 21 Nov 2023 18:40:50 +0100 Message-ID: <20231121174051.63038-6-philmd@linaro.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231121174051.63038-1-philmd@linaro.org> References: <20231121174051.63038-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=philmd@linaro.org; helo=mail-wm1-x336.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=unavailable 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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 9e4aa1fafe added: DEFINE_PROP_ARRAY("pg0-lock", XlnxVersalEFuseCtrl, extra_pg0_lock_n16, extra_pg0_lock_spec, qdev_prop_uint16, uint16_t), but forgot to free the 'extra_pg0_lock_spec' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 9e4aa1fafe ("hw/nvram: Xilinx Versal eFuse device") # v6.2.0+ Signed-off-by: Philippe Mathieu-Daudé --- hw/nvram/xlnx-versal-efuse-ctrl.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse-ctrl.c index beb5661c35..2480af35e1 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -726,6 +726,13 @@ static void efuse_ctrl_init(Object *obj) sysbus_init_irq(sbd, &s->irq_efuse_imr); } +static void efuse_ctrl_finalize(Object *obj) +{ + XlnxVersalEFuseCtrl *s = XLNX_VERSAL_EFUSE_CTRL(obj); + + g_free(s->extra_pg0_lock_spec); +} + static const VMStateDescription vmstate_efuse_ctrl = { .name = TYPE_XLNX_VERSAL_EFUSE_CTRL, .version_id = 1, @@ -764,6 +771,7 @@ static const TypeInfo efuse_ctrl_info = { .instance_size = sizeof(XlnxVersalEFuseCtrl), .class_init = efuse_ctrl_class_init, .instance_init = efuse_ctrl_init, + .instance_finalize = efuse_ctrl_finalize, }; static void efuse_ctrl_register_types(void)