From patchwork Wed Dec 13 13:00:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Michael Tokarev X-Patchwork-Id: 753520 Delivered-To: patch@linaro.org Received: by 2002:adf:ff85:0:b0:336:3f68:820c with SMTP id j5csp182147wrr; Wed, 13 Dec 2023 05:05:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo41bxjsyftniVNpXvXeBf0xRtSgta1BJmJhqo6sEulqCBYBJtDYk3lvhkHBsOf+zFQrtx X-Received: by 2002:a05:620a:1201:b0:77f:521e:3d91 with SMTP id u1-20020a05620a120100b0077f521e3d91mr5460523qkj.10.1702472729740; Wed, 13 Dec 2023 05:05:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702472729; cv=none; d=google.com; s=arc-20160816; b=ULpx9T22ZZ0XOzz/bPTU4DqA7FdGBpyH63KBOOIfC6WxGvLWGA2uFLBL9ygi8cvVXI I7xZoU2QBhYvrDbRTPVbiNiIuNrlcAKk2n0Wz0bKqxeya8VDqjyg/Rkgizee7B2HIF8v owCOpEPiq+7c1kAugA2h3E1zfNQ9dY3r91Bu5epURCXMIQ0CZSixY2ALQpOO+nzhjr9w wb+ZifHbqAlQ7dXqbmVY3rXF9ETNQgEvmP0/X3dFtQ+kCtsLcm22JFwXIGozYVNv1Cke 27rrX+Dg4iX6IoFBoBudBEPjUFenyRKgSpGpBEFnoKEPFx4uq114kL7z4E2Sa4HNvn+z c7Ig== 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=BwVc1iQSyUKIp0kMokNOwrjr/w0VEla96D+AwFuRBsw=; fh=m04Zw7Rd3szriI+fwMSRTbsn9jEhMzlDh3fvULRyulY=; b=z+CY8gEAKdD02Nw3AyiCL7gduivd0UWYL9sd8h1BDo9UKGmMJMQAoud2mcLxaXfHOv 0Ex0R6Rz9iFTi8oZDEyZJu2ugghIlVu074QqgOAFtj/hlAmhmkOHJ+gKsapwGNI6mBC8 Pzv4+9wJxseGPZY85cehhZQNP48Ivspw1BuW/KWqWWiUjpXE6IBJJj1OhGXE9lwcxKlp EAZejP5p2zx1YJi9OnSVsBuH5UWN3+iWn3owSKajxR64VU1UzUG2mmc3pB3cuzIKD6VH nWPNaFs3H4bvX5y6XzRTSpKoC2lNV7Fgc50+7pj2IisPUlv3KhErlOiK5YLQ8Ay/hK7m AKrg== 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 ew4-20020a0562140aa400b0067ab786a0absi12514230qvb.566.2023.12.13.05.05.29 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 13 Dec 2023 05:05:29 -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 1rDOtV-0001Wb-HP; Wed, 13 Dec 2023 08:03:29 -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 1rDOre-00088K-If; 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 1rDOra-00070b-Bh; Wed, 13 Dec 2023 08:01:25 -0500 Received: from tsrv.corpit.ru (tsrv.tls.msk.ru [192.168.177.2]) by isrv.corpit.ru (Postfix) with ESMTP id 7677D3B43E; 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 1C0B33C8CF; Wed, 13 Dec 2023 16:00:42 +0300 (MSK) Received: (nullmailer pid 1024727 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 11/24] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize() Date: Wed, 13 Dec 2023 16:00:20 +0300 Message-Id: <20231213130041.1024630-11-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 68fbcc344e added: DEFINE_PROP_ARRAY("read-only", XlnxEFuse, ro_bits_cnt, ro_bits, qdev_prop_uint32, uint32_t), but forgot to free the 'ro_bits' array. Do it in the instance_finalize handler. Cc: qemu-stable@nongnu.org Fixes: 68fbcc344e ("hw/nvram: Introduce Xilinx eFuse QOM") # v6.2.0+ Signed-off-by: Philippe Mathieu-Daudé Message-id: 20231121174051.63038-5-philmd@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell (cherry picked from commit 49b3e28b7bdfe771150d05c4b5860aa7854a4232) Signed-off-by: Michael Tokarev diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index fdfffaab99..aff5254129 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -217,6 +217,13 @@ static void efuse_realize(DeviceState *dev, Error **errp) } } +static void efuse_finalize(Object *obj) +{ + XlnxEFuse *s = XLNX_EFUSE(obj); + + g_free(s->ro_bits); +} + static void efuse_prop_set_drive(Object *obj, Visitor *v, const char *name, void *opaque, Error **errp) { @@ -273,6 +280,7 @@ static const TypeInfo efuse_info = { .name = TYPE_XLNX_EFUSE, .parent = TYPE_DEVICE, .instance_size = sizeof(XlnxEFuse), + .instance_finalize = efuse_finalize, .class_init = efuse_class_init, };