mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 01:32:21 +02:00
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@mailbox.org> Acked-by: David Hildenbrand (Red Hat) <david@kernel.org> Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-ID: <20251123175750.445461-2-mhi@mailbox.org>
This commit is contained in:
parent
3afcb36309
commit
7c59cc9cf7
|
|
@ -1075,6 +1075,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;
|
||||
|
|
@ -1119,6 +1120,7 @@ static void virtballoon_remove(struct virtio_device *vdev)
|
|||
}
|
||||
|
||||
remove_common(vb);
|
||||
mutex_destroy(&vb->balloon_lock);
|
||||
kfree(vb);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user