From nobody Fri May 17 10:44:26 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1629382532; cv=none; d=zohomail.com; s=zohoarc; b=kiOFj3jXQb/+JYSQhCE/UWDIH2cZKzZfJOt5zfcS9nUpAUODh6BMl0xMQUMYEFtZhHTRFpj9DQiW4ZRa5aj9+Pjrlr7gk7RKXDIzsDt3Xxr3fxVEVt5V2kKlZn+cItaPW8YJEgJFLsPeIZe7D150Xqzx2HV2vk0h2Fibe8KmANY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1629382532; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:MIME-Version:Message-ID:Subject:To; bh=urxwvqXr9zIlOigll43mLC+EktS4CGbb0Pw2LonzhBc=; b=OW0Ns75p8tc83RKsNWRVRQlv3+OqAS/ergdgPvHrLW2Z3AcqUxSLOhCu2YfaVULX7koAozzeKVNprb3YmPsXHyQfMKBU2D85TAi8blIkBmf4svtYa3dnPTZdDdy/0foCdZkzbw/e5Snm+HyI4dEOJwb/3emAA8SP2WMxzmbWCJg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1629382532159642.1915289621804; Thu, 19 Aug 2021 07:15:32 -0700 (PDT) Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-71-zjzCMJJ7McqFnON3QUP39Q-1; Thu, 19 Aug 2021 10:15:29 -0400 Received: by mail-wm1-f71.google.com with SMTP id u15-20020a05600c210fb02902e6a5231792so1605502wml.0 for ; Thu, 19 Aug 2021 07:15:29 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (163.red-83-52-55.dynamicip.rima-tde.net. [83.52.55.163]) by smtp.gmail.com with ESMTPSA id c2sm3048262wrs.60.2021.08.19.07.15.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Aug 2021 07:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629382531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=urxwvqXr9zIlOigll43mLC+EktS4CGbb0Pw2LonzhBc=; b=LcuTM3wPaMtZY6b4X1+JX3ogviMv6sQ/4DyKrNhld+YVVX/mgJcdJl1ylz3TatLpiW7PKK JLlhydK7f6WXfKsZmGf53YKsrhzKC+BNIoqJ84yuU0TtLla+skfdmOEz1IrN+gjnqaHyPE t9Ey8eiBdzIkZH/L/ujd77K17cUu5d4= X-MC-Unique: zjzCMJJ7McqFnON3QUP39Q-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=urxwvqXr9zIlOigll43mLC+EktS4CGbb0Pw2LonzhBc=; b=eyflCmuhYgfjBKAFZjrPNMOfjLu6F1HLsGPHCFBpM2gRTV6q5982bPv1k6PGEoNvrD Cj0LxKGwoaAM5iwIjcPAXIKN1uGc62XqUobPOp/5iFFhG4dLoIXvw4oNAiN9Hh8Hbggc tjwKaRZ0HDRWkKodP4lZ9owbDq3P+ZdR9QLCH2V+nwMqLWYQh8MK417CluzkIzLvScDN 75rWt99ueHyQZaUSNmyVKhZouDAw9GoMDVs6tKCsV4UJVrYfOlswnVMQsYSZ8aQUmjeg 9YwhiAkFLH1hFTLFtRQ18wJVqAW+GMIZKLM4sLTIP1O7zJw5m2FlI31kFda25PSk0saP nZkQ== X-Gm-Message-State: AOAM533E9SMtEIU32yYXlP2Rft5ZAjAMwcCST9u0jyUJ3BDCJDZ+5QFV DVAormlJmUoytLxvDrO1VQwRJ3CGpySpwvTzM6mj4bfbcVWoLn99DOXhBYVxFjZQppbNUMQpvV7 Cu/MzOofiwjEKSQ== X-Received: by 2002:a5d:58cd:: with SMTP id o13mr4178760wrf.421.1629382528860; Thu, 19 Aug 2021 07:15:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9pBwnVyEPU4a/jjXVOj8gPL1c0PRDpt95B5qeHtKROK3FpYUWK70u1xFkocWzyfJh/+8jmA== X-Received: by 2002:a5d:58cd:: with SMTP id o13mr4178734wrf.421.1629382528688; Thu, 19 Aug 2021 07:15:28 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Bin Meng , Peter Maydell , Xuzhou Cheng , qemu-arm@nongnu.org, "Edgar E. Iglesias" , Alistair Francis , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH] hw/dma/xlnx_csu_dma: Fix ptimer resource leak Date: Thu, 19 Aug 2021 16:15:27 +0200 Message-Id: <20210819141527.2821842-1-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1629382533263100001 Fixes: 35593573b25 ("hw/dma: Implement a Xilinx CSU DMA model") Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- hw/dma/xlnx_csu_dma.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/dma/xlnx_csu_dma.c b/hw/dma/xlnx_csu_dma.c index 797b4fed8f5..0c1c19cab5a 100644 --- a/hw/dma/xlnx_csu_dma.c +++ b/hw/dma/xlnx_csu_dma.c @@ -660,6 +660,13 @@ static void xlnx_csu_dma_realize(DeviceState *dev, Err= or **errp) s->r_size_last_word =3D 0; } =20 +static void xlnx_csu_dma_unrealize(DeviceState *dev) +{ + XlnxCSUDMA *s =3D XLNX_CSU_DMA(dev); + + ptimer_free(s->src_timer); +} + static const VMStateDescription vmstate_xlnx_csu_dma =3D { .name =3D TYPE_XLNX_CSU_DMA, .version_id =3D 0, @@ -700,6 +707,7 @@ static void xlnx_csu_dma_class_init(ObjectClass *klass,= void *data) =20 dc->reset =3D xlnx_csu_dma_reset; dc->realize =3D xlnx_csu_dma_realize; + dc->unrealize =3D xlnx_csu_dma_unrealize; dc->vmsd =3D &vmstate_xlnx_csu_dma; device_class_set_props(dc, xlnx_csu_dma_properties); =20 --=20 2.31.1