From nobody Wed Nov 27 04:42:44 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=1700588522; cv=none; d=zohomail.com; s=zohoarc; b=GYo5mnlHxObYB/4BCtNGvkfhjKJefW5WZMmw1XeUZCJtYG+pEv1IrmfAcN8lLQlPRDL8ENXgrGof0QuV5DSEVF8UCXUdzpvj+HW6jxS5nQrr4jft5mhLpQl0t1s3ROE2pVsbqsUVNONUtrQGPtq4/OOtIGEpzjab3yylxH3MaP0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588522; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=oSzcSfZwgHqAqG/jf8MlqCJk5iiUJb969eq9bTdsPE4=; b=jlocrOSnCIycfCaHiqPmIcY/ZHK1XK9WhrhNckQNjAPU0hz+sJ+pjlftDwtLfQ1fG2YZKFvCs8jth6loqV67G1EAHmPyhhaDqIZEgzIKC2b8lNuw2kEokJ+FLFlrBxGdfBVyubG2+ImE4WKPGU9HLs1CL7R2utXvjOumuLoSWc0= 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 1700588522306586.9267900633348; Tue, 21 Nov 2023 09:42:02 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5UkG-0008B4-9e; Tue, 21 Nov 2023 12:41:08 -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 1r5UkE-0008A6-0m for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:06 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5UkA-0001ER-Eg for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:05 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-32f78dcf036so3359f8f.0 for ; Tue, 21 Nov 2023 09:41:02 -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 x5-20020adfffc5000000b0032fb17c65desm14961264wrs.19.2023.11.21.09.40.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:40:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588460; x=1701193260; 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=oSzcSfZwgHqAqG/jf8MlqCJk5iiUJb969eq9bTdsPE4=; b=GFuKUxhxONE592zXAIqk4Os/oFfLk/w1jFlA69hJqdsFDSQoaPe9ew1fZFihv/wfnI My0L3boIgY7ipzt2hcnXn2JcU055Z2AG7etvYWnR8hvghLghGvWmZGU3T8RGy6CR5RJe YYXuiG7ItI8hpv0HIIVcKptuT1tn+YO2e72I5zBu1ZqCEJdyGNFdHWeWwS8KGGdtXA4A 1LoMpAMwuEx4W2w/n5F4H1ccbYjYLj2HEbl3D8PeO3y4kYE1o1fVyu35HSqpYObLaQf9 /F+Ghw/kPBmR/5zBpPy4vA6AcMcKAaEUX2/oaiQRg23xYp0eY5h/VPA5I3MT1Sbx5R3Y 74iQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588460; x=1701193260; 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=oSzcSfZwgHqAqG/jf8MlqCJk5iiUJb969eq9bTdsPE4=; b=ssVWmvb1qo8MTHxAHx/D7MoICtuPCtdc6JbOF12Lrqld9h5+2+8i7HPjpNzsdggM6u sTqnPQDdu/YT89GZALepgNaHN4fDOlXiR3fL2RY8hXdwYDOrQrHHbDnB34Gt9d36HWmn 7d3xDTMAOaWJG6K+QZXZqEI7nP5xZeec6X1i/IOJTdlzZmLElRRklpEGNl6jpJp7Bg34 PdqhSOdTBtT7gDjGv9ARaex48Txo2tOOiF5TiosuqYbUBjZWc3R/ebyE72CUd9ZfvUa8 F0DG0kSD46M0ZsIP+C5e+dSbde7f4jjFVjFtYlrJeBMG1R3tYMcwkoAKfpUunIP2zzib s3Bw== X-Gm-Message-State: AOJu0YxUXmCo9datIrhSYa8AwD4EnBFKM8+Q5/bTjeueu3NCjMY2F+xg qqP+qHO03FHmOpLzc9M2r4LsQ4e7PQRdtuKDRoI= X-Google-Smtp-Source: AGHT+IHmt0mvi7vlSLs++VHKcwpLbBfeokz2SGbLXg55GKtSW31ufa/PFrcxV7Kf9fmVOKJRueoITA== X-Received: by 2002:a5d:6dad:0:b0:332:c593:16e with SMTP id u13-20020a5d6dad000000b00332c593016emr60270wrs.18.1700588460255; Tue, 21 Nov 2023 09:41:00 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.2? 1/6] hw/virtio: Add VirtioPCIDeviceTypeInfo::instance_finalize field Date: Tue, 21 Nov 2023 18:40:46 +0100 Message-ID: <20231121174051.63038-2-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 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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700588522836100001 The VirtioPCIDeviceTypeInfo structure, added in commit a4ee4c8baa ("virtio: Helper for registering virtio device types") got extended in commit 8ea90ee690 ("virtio: add class_size") with the @class_size field. Do similarly with the @instance_finalize field. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/hw/virtio/virtio-pci.h | 1 + hw/virtio/virtio-pci.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/hw/virtio/virtio-pci.h b/include/hw/virtio/virtio-pci.h index 5a3f182f99..59d88018c1 100644 --- a/include/hw/virtio/virtio-pci.h +++ b/include/hw/virtio/virtio-pci.h @@ -246,6 +246,7 @@ typedef struct VirtioPCIDeviceTypeInfo { size_t instance_size; size_t class_size; void (*instance_init)(Object *obj); + void (*instance_finalize)(Object *obj); void (*class_init)(ObjectClass *klass, void *data); InterfaceInfo *interfaces; } VirtioPCIDeviceTypeInfo; diff --git a/hw/virtio/virtio-pci.c b/hw/virtio/virtio-pci.c index 205dbf24fb..e433879542 100644 --- a/hw/virtio/virtio-pci.c +++ b/hw/virtio/virtio-pci.c @@ -2391,6 +2391,7 @@ void virtio_pci_types_register(const VirtioPCIDeviceT= ypeInfo *t) .parent =3D t->parent ? t->parent : TYPE_VIRTIO_PCI, .instance_size =3D t->instance_size, .instance_init =3D t->instance_init, + .instance_finalize =3D t->instance_finalize, .class_size =3D t->class_size, .abstract =3D true, .interfaces =3D t->interfaces, --=20 2.41.0 From nobody Wed Nov 27 04:42:44 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=1700588533; cv=none; d=zohomail.com; s=zohoarc; b=YGsCZ5jzy/K6JCaD6BhHrmh1O1OLpIdemtHwGwgvXZ9XcbqAH2IFZAvf0BNCMrFiBY2xLZMbVIgd3kZN/H3rXM+v0ZeAxlxWV9G/3QBdu++m6ka52nTViNsOw1Lgip00i+zAqMlkn9Nz7HPV5Ln9mFujvHKAYrYJc78QDr8ECfo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588533; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=7clgUrwYfFvC52qM6G31UyIfG1h1zTHGo1j4Nprhx9Y=; b=L3rart0p5RfRQCOkPhMqfhIbh046fBYpOPHHxdW7v6mGNzmxdWl7yvg3i4/6nm44SsNnL9MsYQViXLtLLKbEPIcKhr5UwBKi4J/1llbB6776zhW5EVHORxpSSUFLPVgtpPpcLsi9eQcIlSjyhw8K9244yo9VQEC65Zx/rc5BobM= 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 1700588533416569.0771226999065; Tue, 21 Nov 2023 09:42:13 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5UkJ-0008CP-89; Tue, 21 Nov 2023 12:41:11 -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 1r5UkH-0008BM-9I for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:09 -0500 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5UkF-0001F9-Au for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:09 -0500 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-332cc1f176bso1048023f8f.2 for ; Tue, 21 Nov 2023 09:41:06 -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 m5-20020a5d6a05000000b0032d2489a399sm14777202wru.49.2023.11.21.09.41.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:41:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588466; x=1701193266; 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=7clgUrwYfFvC52qM6G31UyIfG1h1zTHGo1j4Nprhx9Y=; b=WxNqJo97gUwNfvU3T7dZZh3Sn7eXvfPtmQ3EMHu513H7pEu9CcaQFGlwwMjGMe50n9 3ry5sUp8uvFrHU331/s/a2uYNTOlZONmrsohUBYXTmTA6suE0gszJ0Q52U5UKvXhjQfc 4NQFhbuK27YWyPoeXBjRCjkSBYLC0GRXDD1wBCOmSO05SqfL7H98/HtPDOPdmDh1IUCM GC1AEd6F7lWGmRAO+mEwr3QOFeaJJn02D7a/S47c8PlUrsXbQAT6YQwmGkOQ9cIyVylc D4vAXoaFJVWo3if2YUTBhD44fYLlQZN1o8b91Wucv2oEa8TYlwkeQDF4ODA1X73m3Lq6 X5NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588466; x=1701193266; 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=7clgUrwYfFvC52qM6G31UyIfG1h1zTHGo1j4Nprhx9Y=; b=dKTYSEXm3qN1njM5g3i9QsoYmPLeQvccDqyWwOB+J7/wP7S9VnKYzJGGPOyHz3apyP H4aj2UNrmkCrONp3Drxu7tALVp8QWLsORKWXoEpspod8El0yr+yn+L3ZPWBgprDyzAVG KmC23kJmc+VSc3Rzom8u0/XmKtW2KPF02oEgKNhqPstLWOUquzOCh7XNhHRuLXwKIJgT 1IpUBf1fUNy0xWDMjS3xvDXBzgnwr6+h+VpwuvnMplNYadB2v/SP70fi4p/RPv28MfsY mwffEM6IV5q2cnTPe4IXYZaQbc2O7vmZomT5E/dz21Zqamb9mvr1ufQE3XMjx9wWnKqF UC4Q== X-Gm-Message-State: AOJu0YxfE4+XaZHbBwylxLrlAEf+J1k9nZoagxutQInL+Vpf2goXphFa /ws8nrmiif7YxtVmKQP7TCuC1j5PejQ5L++5cN8= X-Google-Smtp-Source: AGHT+IFAeqeyxkEPOW3hl/cQ5TtHveg1sD3Kq/CUZ02FyErAGOSGI0PXfubb6dB2lAP1lbhgdSNwww== X-Received: by 2002:adf:f291:0:b0:331:338c:c74d with SMTP id k17-20020adff291000000b00331338cc74dmr5864753wro.70.1700588465831; Tue, 21 Nov 2023 09:41:05 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH-for-8.2? 2/6] hw/virtio: Free VirtIOIOMMUPCI::vdev.reserved_regions[] on finalize() Date: Tue, 21 Nov 2023 18:40:47 +0100 Message-ID: <20231121174051.63038-3-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 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::42a; envelope-from=philmd@linaro.org; helo=mail-wr1-x42a.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700588534997100001 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 8077b8e549 added: DEFINE_PROP_ARRAY("reserved-regions", VirtIOIOMMUPCI, vdev.nb_reserved_regions, vdev.reserved_regions, qdev_prop_reserved_region, ReservedRegion), but forgot to free the 'vdev.reserved_regions' array. Do it in the instance_finalize() handler. Cc: qemu-stable@nongnu.org Fixes: 8077b8e549 ("virtio-iommu-pci: Add array of Interval properties") # = v5.1.0+ Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Auger --- hw/virtio/virtio-iommu-pci.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/virtio/virtio-iommu-pci.c b/hw/virtio/virtio-iommu-pci.c index 9459fbf6ed..cbdfe4c591 100644 --- a/hw/virtio/virtio-iommu-pci.c +++ b/hw/virtio/virtio-iommu-pci.c @@ -95,10 +95,18 @@ static void virtio_iommu_pci_instance_init(Object *obj) TYPE_VIRTIO_IOMMU); } =20 +static void virtio_iommu_pci_instance_finalize(Object *obj) +{ + VirtIOIOMMUPCI *dev =3D VIRTIO_IOMMU_PCI(obj); + + g_free(dev->vdev.prop_resv_regions); +} + static const VirtioPCIDeviceTypeInfo virtio_iommu_pci_info =3D { .generic_name =3D TYPE_VIRTIO_IOMMU_PCI, .instance_size =3D sizeof(VirtIOIOMMUPCI), .instance_init =3D virtio_iommu_pci_instance_init, + .instance_finalize =3D virtio_iommu_pci_instance_finalize, .class_init =3D virtio_iommu_pci_class_init, }; =20 --=20 2.41.0 From nobody Wed Nov 27 04:42:44 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=1700588600; cv=none; d=zohomail.com; s=zohoarc; b=Rtvoe0hgYYsJQXwFz2nkNrKzKmcRqWYVwZkR450mkFbWbI9nHtIUGRv7fRAbqf40U2cWF/J5HBHpMQ6pWroFMNFrvt/15pfHmX6fIhpZ2ugw5E2L2DNkPDjn30C2U0cu0w4qol7jRZJEKMCYXVIZj4ULEtEd8Mv0rpYHlqt+cNs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588600; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=3gZmZAr8kYS7gDEfj38KOIHMYLXNb4HUKsj/RIzSduo=; b=hEyv07gpPQuCkeFDdT3e8yY3Ww9DBDEsH1Gbfwa9BJR4BnhrRqlTiK232ZbNLbgvoYfdXPWrBdNt2bxKvoBatjkyr3VyJ74S3zdCzZsYOIXcwkgjsjVoWveSNOyqXomKqe1iMWL3WeLDp/RkHtg2bjdlgCu7y5ZeBfL2/td6Qik= 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 1700588600383765.783435852202; Tue, 21 Nov 2023 09:43:20 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5UkP-0008E4-3y; Tue, 21 Nov 2023 12:41:17 -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 1r5UkN-0008Da-DM for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:15 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5UkK-0001Fv-Pg for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:15 -0500 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-32fdc5be26dso3738824f8f.2 for ; Tue, 21 Nov 2023 09:41:12 -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 m5-20020a5d6a05000000b0032d2489a399sm14777400wru.49.2023.11.21.09.41.10 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:41:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588471; x=1701193271; 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=3gZmZAr8kYS7gDEfj38KOIHMYLXNb4HUKsj/RIzSduo=; b=dVISFH7i4vWRLm5MJo0BMF6C4zd0M6+80ab3QY/OpMuxVRV7GOihYzV4xrz85dNMay JaFUIUnKnxQbPEBO90p3AUAXCCYFsJ3+qFKr455/MiEUCIyJ67S4dgDu2PwKEHqpxzLn D2vHJfYOcu9Z6BQiCHKO95jE9b/SBsfyY7pHBw1egPvGGr/icfpOnRLESzfRr1eF7wuR SdiuByVoQWhZWqneEMvpkGdvUAyIinlJ5vSMOAcIzFvZlmB8Qhn5I7KmvqV8yzHKTjRe 7K1mF05LBvM4acwNmYLUFDlitCQ8pIsuSlABNoRy0BzQ2e6cYr1vbpfATD7slWCJF7x1 melg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588471; x=1701193271; 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=3gZmZAr8kYS7gDEfj38KOIHMYLXNb4HUKsj/RIzSduo=; b=Se3nGK0mTNqKcLE9BY2mxS6TUUaFg6OEzO8dg8Lj+Lqpz2lPwt4Vs1SjmzFzLUB96O CjTg1OG8Q7vTRIUBixF5+6Cy7/b4MCHgG6d4Mublv9jLztKdfL5mUf0f5IPGeaaMcQam Y66HIXu+WCGNz/5dba1BDUubYBm1PcC+AsjrSySB3QkiajVmrIeAguJrNB4jfAJLjX8B C5svoN6yiIn5P4PnmtD/MyWJ0ZRi3QehjdTTLa3J87VRw8S8AhTBLEi0k/oW7wtRzuEv ZV/HH919kk3mVBcgCBd1+QuiEYuRVSuNGadlyUDOgmOgIStEfGyV7XWQoWGnFQNOLrnx 2JVQ== X-Gm-Message-State: AOJu0YwC+N1/5yUS6zy1V82R9iGeLLL5XxXCLqRYi3A7DsiBer/u8Q86 Kp1wYM7fzh7UNfHG6FJiWL8X+vWmirfOkOcf+Kg= X-Google-Smtp-Source: AGHT+IFuKR6qCCBXAcv+2JhWqpj8WFpnTVNl+uGVZmRBHZEc6xCHEwFeF6RkqeBNgcHXda4vx590ag== X-Received: by 2002:a5d:64ec:0:b0:332:c9e7:3d1a with SMTP id g12-20020a5d64ec000000b00332c9e73d1amr4672410wri.62.1700588471330; Tue, 21 Nov 2023 09:41:11 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH-for-8.2? 3/6] hw/misc/mps2-scc: Free MPS2SCC::oscclk[] array on finalize() Date: Tue, 21 Nov 2023 18:40:48 +0100 Message-ID: <20231121174051.63038-4-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 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::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700588601128100001 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 --- 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 b3b42a792c..fe5034db14 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.41.0 From nobody Wed Nov 27 04:42:44 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=1700588562; cv=none; d=zohomail.com; s=zohoarc; b=aFwFDhltuKz3dePhsS2pAXzfNa/YUVvD4sIi3Osk2LFvtmABVh2iTR48HdUXbIwgqV7rYzfySC7phAzrmymmN1fwKARzwSStzpOi9rZlBdq1Fz0Eoy9XxYMv12in8xwnMpn/l+GR7xyIfn7o69AltcYok3PVvfBtDMieU4jSswA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588562; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=gXPnP9OotZkXe8sn/bINkpH4C8HDZjSGF7IOUTkUbPk=; b=CJXkP75KoaZmzwpLKmXSR/wTrPXjX6PW+bsePz5A5b5HaxRuiaYRpo41CxI4hUt5YbQiUiCpNF/gKndU7XmQwibT9Rf8WN6rMbZqb4cooXi34AcM9QiT/CjMe/Myv97ok3w4m+UHWoL0NN/swLu4Ct9j3lgkjCuY9tl+znEfGwI= 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 1700588562899451.9680679099946; Tue, 21 Nov 2023 09:42:42 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5UkW-0008JW-VL; Tue, 21 Nov 2023 12:41:24 -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 1r5UkV-0008Gy-O0 for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:23 -0500 Received: from mail-lj1-x22b.google.com ([2a00:1450:4864:20::22b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5UkT-0001I6-0a for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:23 -0500 Received: by mail-lj1-x22b.google.com with SMTP id 38308e7fff4ca-2c5071165d5so72868311fa.0 for ; Tue, 21 Nov 2023 09:41:20 -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 q3-20020a05600c46c300b0040b2b9bf321sm1973474wmo.9.2023.11.21.09.41.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:41:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588477; x=1701193277; 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=gXPnP9OotZkXe8sn/bINkpH4C8HDZjSGF7IOUTkUbPk=; b=pfCxfaM/Iu4cjgXIz6vPbUyg3Xiuntw3jkcVU6Az9/mEJLI/Kd7Katklybn/Vx0xhc 8l9SaDCzDXKAx+f/0uUpdM3Qfxye1fKYXeDsGtjf9Q0qf2QC+iIWdGmg7fb3OT17Ksn0 peZqedRvrxtDH++swZa8ULdVJczFpr30yEJmDLGy8jadHR0G6OzFaNmiO0rXtXLfMpuF 3HJTplHXmyg7FB86KUacgD2ul7aoNFhnAJ97Io50KXVQDCneHhWplI6uMyxLgw9xhs07 Eq4F0z04lwFK70mWo6owotPCnmGRIFXAM5+bcmqzH++nt2GI0rSUlngkbMQ4fpc5KoEK 3CKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588477; x=1701193277; 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=gXPnP9OotZkXe8sn/bINkpH4C8HDZjSGF7IOUTkUbPk=; b=tvVkbJtUHY1SmzteHocdPkt7hegt+JLvE0k+8Rg08/hvwxSNuGCQhYX4BIc4fF0Z4R WUCb0nDEWkEJUNZbbgy3x5jHDin9ja0QsdaKaYcarR5RD0HWGC5NGy6MY10ep2GHpgnj j7KI2n6h/RAfzacUiaBHtJSO7gEemxbrhThvHmBxXbAk24ireyo3VKdbzuE+U63mw4x3 6sxu/aC84WzsmOW+jfQdZiiGwvm0whoCZUGRQc9SfbLM3iF0Wras1Q7nCaMcye4D07PJ SYAjbwaMZdk7n22HkTUFdz69FJr/NLuo+oL5yyZ4EWlXDFv0o/Y+IRi0Bb1P48NH18RJ oPlQ== X-Gm-Message-State: AOJu0YxPDhllJ87zKF4uFVwikNZ2cW5rUCvnph0dDr/fDSqNeJFjv2vD cMcLMZfF3dEeAAfiO06AeGw+HlbfdF3cQRX4uIY= X-Google-Smtp-Source: AGHT+IHQt7ZOkZ79GjbZX+dGoRoNzu0CR9PKcE8/LDomOjUyzreHNNTN18u/nzqEAz/WuKnh8WuZMQ== X-Received: by 2002:a2e:9b95:0:b0:2c1:9a8b:f67 with SMTP id z21-20020a2e9b95000000b002c19a8b0f67mr6777111lji.1.1700588477006; Tue, 21 Nov 2023 09:41:17 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= , qemu-stable@nongnu.org Subject: [PATCH-for-8.2? 4/6] hw/nvram/xlnx-efuse: Free XlnxEFuse::ro_bits[] array on finalize() Date: Tue, 21 Nov 2023 18:40:49 +0100 Message-ID: <20231121174051.63038-5-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 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::22b; envelope-from=philmd@linaro.org; helo=mail-lj1-x22b.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: 1700588564965100003 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=C3=A9 --- hw/nvram/xlnx-efuse.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/nvram/xlnx-efuse.c b/hw/nvram/xlnx-efuse.c index 655c40b8d1..f7b849f7de 100644 --- a/hw/nvram/xlnx-efuse.c +++ b/hw/nvram/xlnx-efuse.c @@ -224,6 +224,13 @@ static void efuse_realize(DeviceState *dev, Error **er= rp) } } =20 +static void efuse_finalize(Object *obj) +{ + XlnxEFuse *s =3D 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) { @@ -280,6 +287,7 @@ static const TypeInfo efuse_info =3D { .name =3D TYPE_XLNX_EFUSE, .parent =3D TYPE_DEVICE, .instance_size =3D sizeof(XlnxEFuse), + .instance_finalize =3D efuse_finalize, .class_init =3D efuse_class_init, }; =20 --=20 2.41.0 From nobody Wed Nov 27 04:42:44 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=1700588551; cv=none; d=zohomail.com; s=zohoarc; b=ZzUKA86/7IyysAep9jL//2l43DP0xZwSAxsji7TEI2m077aLPMO6uzOOho3yOZRSkB0YkGBQSLXGyq3+z6v0Yh3h1tdoW3hzsEGVUrwaCxn8XsrG/yLw6Tyxng4WvimTzaSdT5NOAOz0U9G9/HTXQR83bm31PtyfiSxERgvYbWk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588551; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=iW4GbGx1UKeBuWo5IN5MHnetcyTDNo6L05KNntf8yQU=; b=eH6Bnhy0BUT0pFBLrwQ2aGIc0LJN/p+urVP52cupjPONDzYZOiqh0MDRNBoEsHBzeDJxYWTewf+R9Q8MSxRrK6xJTvL9Ny4sL/BKfIQCHwl4PA7N7dLE14siwl3kd+nNUY84uprEwEdN2wvV1QfWR7x+WYeQikFOdTq2+WnI0Ow= 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 1700588551913900.1142809456323; Tue, 21 Nov 2023 09:42:31 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AGHT+IHW0fAcvFPF7LgXXhrbf09snejqukoxr7+XwrR9MZy9hDLv4rujTlAMOa2gwAY3uQ/ZIVVM8A== 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) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-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 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::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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700588552962100003 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=C3=A9 --- 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); } =20 +static void efuse_ctrl_finalize(Object *obj) +{ + XlnxVersalEFuseCtrl *s =3D XLNX_VERSAL_EFUSE_CTRL(obj); + + g_free(s->extra_pg0_lock_spec); +} + static const VMStateDescription vmstate_efuse_ctrl =3D { .name =3D TYPE_XLNX_VERSAL_EFUSE_CTRL, .version_id =3D 1, @@ -764,6 +771,7 @@ static const TypeInfo efuse_ctrl_info =3D { .instance_size =3D sizeof(XlnxVersalEFuseCtrl), .class_init =3D efuse_ctrl_class_init, .instance_init =3D efuse_ctrl_init, + .instance_finalize =3D efuse_ctrl_finalize, }; =20 static void efuse_ctrl_register_types(void) --=20 2.41.0 From nobody Wed Nov 27 04:42:44 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=1700588537; cv=none; d=zohomail.com; s=zohoarc; b=LUUiThVsJW41R+NIVlmGP8XI7/ieEAabhBUVtrARCHEDUHzzgkurserIVZnFTXy53ztl8Xpf6nxCCwdx/CKE3Msl1QFLQZixV3H/xSA1Y4bymLtrcIWVZ32//JpehyCVfgrUE+4LMKYQdcdKJiVNtJ1D4U4VIzGwzi33bHrCvjA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700588537; h=Content-Type:Content-Transfer-Encoding:Cc:Cc: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; bh=wLvcXpQco99sa0+Z1Qj96SBcGgbn4oS7DYVe2UC+AGE=; b=abw4RukmZ9iHwkjh1oL/9l+PRCJWvNe/xBXb48NeSzk0ij+ifmMmnkpNcb27EGyFuZmFMfCzPkh6Z21hcJ1Pps1aRDUPTwrWen0qkXOyPOEVExVLal/aGDNQ1+4e1sYz5ZRB8n5CQ/7C5r0lhwRRbKlHd4935rWnayp0y6azsF8= 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 1700588537243765.6066750436229; Tue, 21 Nov 2023 09:42:17 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r5Ukg-0008Uc-1G; Tue, 21 Nov 2023 12:41:34 -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 1r5Uke-0008Ty-MW for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:32 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r5Ukc-0001Kn-4l for qemu-devel@nongnu.org; Tue, 21 Nov 2023 12:41:32 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4083f613272so31617495e9.1 for ; Tue, 21 Nov 2023 09:41:29 -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 h18-20020a05600c351200b004063ea92492sm18045128wmq.22.2023.11.21.09.41.27 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 21 Nov 2023 09:41:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1700588488; x=1701193288; 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=wLvcXpQco99sa0+Z1Qj96SBcGgbn4oS7DYVe2UC+AGE=; b=lN9xlfjc+TqtWvYl4GApf6dvwQJ5fKLq8/U8Qh/fqepQD3cKIecXgYv9T0MzOR4rRd /qbKPF+D7/kbDdM4vULD8vXkkwa+GSxf9/R3ummYrKO9mOfSHT4HbCzhHvcGC3Nz8J2N BiHvmkztAXbBOvADszrT4ZfmGq++SKms7FadSiVG52URDskt7n/zyAWBqysadS/WfaAf d/jRn10MfZ9e7K2Q1rRxnZZShShgZGHYOJtGFlmS4T+1fkjzGHbH20zB1XZb6CRusjn9 fneXW1VpDrKeT3pABhDWEQ99s2Qg56wf6sEj6cY14QWMNKaMUP4m+pcmHhXscGQw+UBh agLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700588488; x=1701193288; 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=wLvcXpQco99sa0+Z1Qj96SBcGgbn4oS7DYVe2UC+AGE=; b=JC02pJhZfda6+qgKr6KQb1CAik4ocpqT4lOM9QE/LapRxpU8oH+ecZ33dM2NKIMNra L7gQKcDZi+BFOYXon4kZ0KihNqXYKHMvPcaX3ZWM3Zd20UNJFMtShRd3D9M5hC91HSSA 6z/DSjGUcbW1TNlVNRFIrvcVmE+2J+IoR1zWXSUfQp4eHqTrvoUV63suFDAgzJV77u8B tvy1etJx7kOpfSM0hgz7IIJ7+xI0n6bV9C4qRVfMWx6Ra+3Vf3eQNgG1e5YjMwYIkE2Y 3ZU9RniCi5BL9g5ca5pGXxRcfF+Sc/br4UEH8pEzYENtIFfiqDqyAXpW7mtkmOHJ3BEn 5UZg== X-Gm-Message-State: AOJu0YzkAj5vjZSrtHSH8cDKfKY9dEGPeHNOTZaWHAurREwa+2btFQnb ydGUDZEvAw6S/JzcDCSNuN+LxV/E8M1JaUmZWzQ= X-Google-Smtp-Source: AGHT+IGHVGKFxburPV8+OPcDcSlkReHX1Kc9dILYPy0rJ2ALh04RoVy2ObtFGWRbu2+42cJ+mJwMRg== X-Received: by 2002:a05:600c:35c9:b0:40b:2a20:3d3 with SMTP id r9-20020a05600c35c900b0040b2a2003d3mr32186wmq.30.1700588488447; Tue, 21 Nov 2023 09:41:28 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-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=20Mathieu-Daud=C3=A9?= Subject: [PATCH-for-8.2 6/6] hw/input/stellaris_gamepad: Free StellarisGamepad::keycodes[] array Date: Tue, 21 Nov 2023 18:40:51 +0100 Message-ID: <20231121174051.63038-7-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 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::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1700588538882100003 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 a75f336b97 added: DEFINE_PROP_ARRAY("keycodes", StellarisGamepad, num_buttons, keycodes, qdev_prop_uint32, uint32_t), but forgot to free the 'keycodes' array. Do it in the instance_finalize handler. Fixes: a75f336b97 ("hw/input/stellaris_input: Convert to qdev") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/input/stellaris_gamepad.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c index 06a0c0ce83..9dfa620e29 100644 --- a/hw/input/stellaris_gamepad.c +++ b/hw/input/stellaris_gamepad.c @@ -63,6 +63,13 @@ static void stellaris_gamepad_realize(DeviceState *dev, = Error **errp) qemu_input_handler_register(dev, &stellaris_gamepad_handler); } =20 +static void stellaris_gamepad_finalize(Object *obj) +{ + StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); + + g_free(s->keycodes); +} + static void stellaris_gamepad_reset_enter(Object *obj, ResetType type) { StellarisGamepad *s =3D STELLARIS_GAMEPAD(obj); @@ -92,6 +99,7 @@ static const TypeInfo stellaris_gamepad_info[] =3D { .name =3D TYPE_STELLARIS_GAMEPAD, .parent =3D TYPE_SYS_BUS_DEVICE, .instance_size =3D sizeof(StellarisGamepad), + .instance_finalize =3D stellaris_gamepad_finalize, .class_init =3D stellaris_gamepad_class_init, }, }; --=20 2.41.0