From patchwork Tue Dec 12 12:18:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753052 Delivered-To: patch@linaro.org Received: by 2002:a5d:4c83:0:b0:333:3a04:f257 with SMTP id z3csp1868565wrs; Tue, 12 Dec 2023 04:22:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IESJq7IJwcBzD8jWDEQkT1AvKaz0qQ+lpY6LgrjoCnyLbE429+QMUJLE5tszD755xLCPGhy X-Received: by 2002:a05:622a:1308:b0:425:8b43:29e9 with SMTP id v8-20020a05622a130800b004258b4329e9mr8603389qtk.33.1702383744931; Tue, 12 Dec 2023 04:22:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702383744; cv=none; d=google.com; s=arc-20160816; b=Nu436hZBxLeUSBqq5UWv/dJ9l1qF+PP6e89ob9hGdgu7iYk7CuZKTvs4xViErvR78t LST6mjQ+l1OMVw/vzUnZR/CxMoUMhxC0OWqEukc/hJubjHLPPWh9fMf/lpxRrKt5tfx0 IkkLQs1FVbrHku3rS26EBEXIwfOy6ZJ8UIhuKHIGIvSxlDeu3vdotRXTMA3d84ZNFIxW 9dcbxeyXAX22ykC+ZHav6+mNmOo8Rf2+Du4J/f/34jcH36sXgbyGpQpiaj77F8z90umB 9HfZwrASgEJ3E1ZWuPmcdrkjBswlmriSnTUbx614IIoauDkJDy7iLns2cWE3c8K7JBek jSfA== 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; bh=8Dw1cdwwP/OzDQZ8ldHmvY36ECfWJKMAA4KFmXSINA0=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=a3lDhG1WL9UMxZZySxuZ5vTCAyBpzAqBZ3B1VTv8Y5WSlUxdMlXpTGU6u+R+2R4SMK G331vgrZwWt+A2ekxj7jR50IeTFxXDVd7nclHraKD8L2dsu0DglKfiAI3Ej9fps2gujd xm+pj1ZwCS0U0potOFEZMsw/x8K2+v86kLQ8k93KHTaxdupXrWi4/k9FIPRL6nCm/nHY 8TrDRhffvcxrIMz2YqcMl6g8rNtziR+ymthnHQ0aacHvdf4twBc8mEcKzsq01GLi0Fe/ MPmfYintysVmpK0/rAMtcLsI7DoizB+L8YN6LrWkXEfmiqWRr06DBhqYwmaRK1pAIiLH YQAg== ARC-Authentication-Results: i=1; mx.google.com; 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" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id fg6-20020a05622a580600b0042581018839si11617970qtb.785.2023.12.12.04.22.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 12 Dec 2023 04:22:24 -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; 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" Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rD1kj-0007Hb-Ir; Tue, 12 Dec 2023 07:20:45 -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 1rD1kS-0006tx-6L; Tue, 12 Dec 2023 07:20:32 -0500 Received: from isrv.corpit.ru ([86.62.121.231]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rD1kN-0000km-Pf; Tue, 12 Dec 2023 07:20:27 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 410213AF08; Tue, 12 Dec 2023 15:18:50 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 071F63B956; Tue, 12 Dec 2023 15:18:33 +0300 (MSK) Received: (nullmailer pid 1003459 invoked by uid 1000); Tue, 12 Dec 2023 12:18:31 -0000 From: Michael Tokarev To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Peter Maydell , Michael Tokarev Subject: [Stable-8.1.4 20/31] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array Date: Tue, 12 Dec 2023 15:18:08 +0300 Message-Id: <20231212121831.1003318-20-mjt@tls.msk.ru> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: MIME-Version: 1.0 Received-SPF: pass client-ip=86.62.121.231; envelope-from=mjt@tls.msk.ru; helo=isrv.corpit.ru X-Spam_score_int: -68 X-Spam_score: -6.9 X-Spam_bar: ------ X-Spam_report: (-6.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_HI=-5, 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé 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é Message-id: 20231121174051.63038-6-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 4f10c66077e39969940d928077560665e155cac8) Signed-off-by: Michael Tokarev diff --git a/hw/nvram/xlnx-versal-efuse-ctrl.c b/hw/nvram/xlnx-versal-efuse-ctrl.c index b35ba65ab5..2d2dc09526 100644 --- a/hw/nvram/xlnx-versal-efuse-ctrl.c +++ b/hw/nvram/xlnx-versal-efuse-ctrl.c @@ -725,6 +725,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, @@ -762,6 +769,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)