[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251123175750.445461-2-mhi@mailbox.org>
Date: Sun, 23 Nov 2025 18:57:48 +0100
From: Maurice Hieronymus <mhi@...lbox.org>
To: david@...nel.org,
mst@...hat.com,
jasowang@...hat.com
Cc: virtualization@...ts.linux.dev,
linux-kernel@...r.kernel.org,
Maurice Hieronymus <mhi@...lbox.org>
Subject: [PATCH 1/2] virtio-balloon: Destroy mutex before freeing virtio_balloon
Add a call to mutex_destroy in the error code path as well as in the
virtballoon_remove code path.
Signed-off-by: Maurice Hieronymus <mhi@...lbox.org>
---
drivers/virtio/virtio_balloon.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 1b93d8c64361..078b87720a0d 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1094,6 +1094,7 @@ static int virtballoon_probe(struct virtio_device *vdev)
out_del_vqs:
vdev->config->del_vqs(vdev);
out_free_vb:
+ mutex_destroy(&vb->balloon_lock);
kfree(vb);
out:
return err;
@@ -1138,6 +1139,7 @@ static void virtballoon_remove(struct virtio_device *vdev)
}
remove_common(vb);
+ mutex_destroy(&vb->balloon_lock);
kfree(vb);
}
--
2.50.1
Powered by blists - more mailing lists