From patchwork Wed Dec 13 13:00:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753524 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp183130wrr; Wed, 13 Dec 2023 05:07:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3ydOSUIj6ItIP5Ij+JUl2yJCAw3pDZ0Fe/eb/Pq/JeD96qChUBPFKuvvpDVynEUgVJ4Ot X-Received: by 2002:a0c:d802:0:b0:67a:bf83:7510 with SMTP id h2-20020a0cd802000000b0067abf837510mr9349178qvj.20.1702472831755; Wed, 13 Dec 2023 05:07:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472831; cv=none; d=google.com; s=arc-20160816; b=uXDBUZoJIBlDjwJGXWM1/063fQzOcc+UaBBDDW/z5Bbnga6zErAPomSs1tLI3O2n1M TgN7XFuFvPnUzaUCfZE1W3ZX0wBBr/PphgdR3NC5mJvY8jX2eTi1nFRjhdqnxZtz1A5m lr3lj3KwUP9JYKKdqxY6ltwMmJGKCaXFzvFJ9uVAfA/ZuGUiai50gvjbjyVaA66D3V6r VFMSOG4krexxzTKaTjy4B3WubF1itQkFpSPeN9RZd1evrzEf/7qj1Uohuj6qSCjpVsf2 2ZnfJFlKZ6r/gMs0s77sLH0iQ9ZNhWR7lBkN2b96P9/U1OBpAlYacGaUQ4o+hJqZ8VXd a3cA== 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=pQ1mjrOCOAXhybtzfE2AdrG2LEbO5sdYEii66JI9289I7p2sFrsb3lQSys9rRmRkEC 1jByIyhRg2Qni1TKep2k8jH6kd1VMrvIi/FwSThB+RliTtVxMcIebF8xkgs+NhrJFiXF vF7sUcrqa5vTinQXYejU2Nakeir48yn7JcsW9Z70Z+Ynay2WfJZupDqrgVx7n087a7rK Lz5JMHLhU4EPYKkJP9202URINH+yp8AIILoc7V7ELeWQkHY14kX/RxUYUFJ8/I9TK59N mOMQhj86Zl8JwebUNv+27O/a9FNOozc4aEP1FWeYwHN/FICOiMf9IxaESl7MOBbBX13F RMQw== 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 pn20-20020a056214131400b0067ed674a853si7291708qvb.312.2023.12.13.05.07.11 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:07:11 -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 1rDOsl-0000QH-04; Wed, 13 Dec 2023 08:02:35 -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 1rDOrh-00088d-4E; Wed, 13 Dec 2023 08:01:30 -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 1rDOrf-00071K-BZ; Wed, 13 Dec 2023 08:01:28 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 875473B43F; Wed, 13 Dec 2023 16:01:01 +0300 (MSK) Received: from tls.msk.ru (mjt.wg.tls.msk.ru [192.168.177.130]) by tsrv.corpit.ru (Postfix) with SMTP id 2CB6A3C8D0; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024730 invoked by uid 1000); Wed, 13 Dec 2023 13:00:41 -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-7.2.8 12/24] hw/nvram/xlnx-efuse-ctrl: Free XlnxVersalEFuseCtrl[] "pg0-lock" array Date: Wed, 13 Dec 2023 16:00:21 +0300 Message-Id: <20231213130041.1024630-12-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)