[PATCH 0/2] Add calls to mutex_destroy in virtio_balloon and virtio_mem

Maurice Hieronymus posted 2 patches 1 week, 1 day ago
drivers/virtio/virtio_balloon.c | 2 ++
drivers/virtio/virtio_mem.c     | 2 ++
2 files changed, 4 insertions(+)
[PATCH 0/2] Add calls to mutex_destroy in virtio_balloon and virtio_mem
Posted by Maurice Hieronymus 1 week, 1 day ago
In [1] it is pointed out that each mutex_init call should have a
corresponding call to mutex_destroy; otherwise, it is considered a bug.

This patch adds the calls to mutex_destroy in virtio_balloon as well
as virtio_mem.

Link: https://lists.kernelnewbies.org/pipermail/kernelnewbies/2025-November/023493.html [1]

Maurice Hieronymus (2):
  virtio-balloon: Destroy mutex before freeing virtio_balloon
  virtio-mem: Destroy mutex before freeing virtio_mem

 drivers/virtio/virtio_balloon.c | 2 ++
 drivers/virtio/virtio_mem.c     | 2 ++
 2 files changed, 4 insertions(+)


base-commit: d13f3ac64efb868d09cb2726b1e84929afe90235
-- 
2.50.1
Re: [PATCH 0/2] Add calls to mutex_destroy in virtio_balloon and virtio_mem
Posted by David Hildenbrand (Red Hat) 1 week ago
On 11/23/25 18:57, Maurice Hieronymus wrote:
> In [1] it is pointed out that each mutex_init call should have a
> corresponding call to mutex_destroy; otherwise, it is considered a bug.

IIUC, mutex_destroy() only ever does something during with 
CONFIG_DEBUG_MUTEXES. And there, it performs mostly sanity checks (so 
it's not some missed memory freeing etc).

I wonder whether we should still ad Fixes tags.

-- 
Cheers

David