[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 0/4] qemu-timer: Make timer_free() imply timer_del()
From: |
Peter Maydell |
Subject: |
Re: [PATCH v2 0/4] qemu-timer: Make timer_free() imply timer_del() |
Date: |
Thu, 7 Jan 2021 21:18:33 +0000 |
On Tue, 15 Dec 2020 at 15:41, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Currently timer_free() is a simple wrapper for g_free(). This means
> that the timer being freed must not be currently active, as otherwise
> QEMU might crash later when the active list is processed and still
> has a pointer to freed memory on it. As a result almost all calls to
> timer_free() are preceded by a timer_del() call, as can be seen in
> the output of
> git grep -B1 '\<timer_free\>'
>
> This is unfortunate API design as it makes it easy to accidentally
> misuse (by forgetting the timer_del()), and the correct use is
> annoyingly verbose.
I'll take this via the target-arm queue. Thanks to all for the review.
-- PMM