[PATCH] hw/misc/bcm2835_powermgt: Free the watchdog timer

Akihiko Odaki posted 1 patch 1 week, 6 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260913-bcm2835-v1-1-b3719ca0df13@rsg.ci.i.u-tokyo.ac.jp
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
hw/misc/bcm2835_powermgt.c | 8 ++++++++
1 file changed, 8 insertions(+)
[PATCH] hw/misc/bcm2835_powermgt: Free the watchdog timer
Posted by Akihiko Odaki 1 week, 6 days ago
It leaks with introspection.

Fixes: 21fcfb604608 ("hw/misc/bcm2835_powermgt: implement a real watchdog timer")
Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
---
 hw/misc/bcm2835_powermgt.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/misc/bcm2835_powermgt.c b/hw/misc/bcm2835_powermgt.c
index 7b01be48bb7f..1de5a55a4f5b 100644
--- a/hw/misc/bcm2835_powermgt.c
+++ b/hw/misc/bcm2835_powermgt.c
@@ -152,6 +152,13 @@ static void bcm2835_powermgt_init(Object *obj)
                                  bcm2835_powermgt_expire, s);
 }
 
+static void bcm2835_powermgt_finalize(Object *obj)
+{
+    BCM2835PowerMgtState *s = BCM2835_POWERMGT(obj);
+
+    timer_free(s->wdog_timer);
+}
+
 static void bcm2835_powermgt_reset(DeviceState *dev)
 {
     BCM2835PowerMgtState *s = BCM2835_POWERMGT(dev);
@@ -177,6 +184,7 @@ static const TypeInfo bcm2835_powermgt_info = {
     .instance_size = sizeof(BCM2835PowerMgtState),
     .class_init    = bcm2835_powermgt_class_init,
     .instance_init = bcm2835_powermgt_init,
+    .instance_finalize = bcm2835_powermgt_finalize,
 };
 
 static void bcm2835_powermgt_register_types(void)

---
base-commit: 209b2afaface001c7d4d981e38f186afe7b24a50
change-id: 20260913-bcm2835-947bbe027c0b

Best regards,
--  
Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Re: [PATCH] hw/misc/bcm2835_powermgt: Free the watchdog timer
Posted by Peter Maydell 1 week, 5 days ago
On Sun, 13 Sept 2026 at 07:44, Akihiko Odaki
<odaki@rsg.ci.i.u-tokyo.ac.jp> wrote:
>
> It leaks with introspection.
>
> Fixes: 21fcfb604608 ("hw/misc/bcm2835_powermgt: implement a real watchdog timer")
> Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> ---
>  hw/misc/bcm2835_powermgt.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

Hi; Thomas Huth sent the same patch a few days earlier:
https://patchew.org/QEMU/20260910175001.76278-1-thuth@redhat.com/
so I'm going to take that version.

thanks
-- PMM
Re: [PATCH] hw/misc/bcm2835_powermgt: Free the watchdog timer
Posted by Marc-André Lureau 1 week, 5 days ago
Hi

On Mon, Sep 14, 2026 at 1:32 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Sun, 13 Sept 2026 at 07:44, Akihiko Odaki
> <odaki@rsg.ci.i.u-tokyo.ac.jp> wrote:
> >
> > It leaks with introspection.
> >
> > Fixes: 21fcfb604608 ("hw/misc/bcm2835_powermgt: implement a real watchdog timer")
> > Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> > ---
> >  hw/misc/bcm2835_powermgt.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
>
> Hi; Thomas Huth sent the same patch a few days earlier:
> https://patchew.org/QEMU/20260910175001.76278-1-thuth@redhat.com/
> so I'm going to take that version.

And earlier!
https://patchew.org/QEMU/20260906-nohmp-next-v1-0-2b21e63974f3@redhat.com/20260906-nohmp-next-v1-3-2b21e63974f3@redhat.com/

thanks

>
> thanks
> -- PMM
>


-- 
Marc-André Lureau
Re: [PATCH] hw/misc/bcm2835_powermgt: Free the watchdog timer
Posted by Peter Maydell 1 week, 5 days ago
On Mon, 14 Sept 2026 at 11:33, Marc-André Lureau
<marcandre.lureau@gmail.com> wrote:
>
> Hi
>
> On Mon, Sep 14, 2026 at 1:32 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> >
> > On Sun, 13 Sept 2026 at 07:44, Akihiko Odaki
> > <odaki@rsg.ci.i.u-tokyo.ac.jp> wrote:
> > >
> > > It leaks with introspection.
> > >
> > > Fixes: 21fcfb604608 ("hw/misc/bcm2835_powermgt: implement a real watchdog timer")
> > > Signed-off-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
> > > ---
> > >  hw/misc/bcm2835_powermgt.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> >
> > Hi; Thomas Huth sent the same patch a few days earlier:
> > https://patchew.org/QEMU/20260910175001.76278-1-thuth@redhat.com/
> > so I'm going to take that version.
>
> And earlier!
> https://patchew.org/QEMU/20260906-nohmp-next-v1-0-2b21e63974f3@redhat.com/20260906-nohmp-next-v1-3-2b21e63974f3@redhat.com/

Ah, I missed that one as it was inside a larger series. I've fished
it out of there since yours has precedence :-)

-- PMM