virtio: fix freeing of virtio ring buffer
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sat, 26 Jul 2025 06:17:58 +0000 (08:17 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 7 Aug 2025 17:15:54 +0000 (11:15 -0600)
commit4b97de0e28fc215d3f41bb01f3410baa5e9243d8
treed21c2a8b93a0d0bc1cabcfe79e498a823ae34324
parentc60898c9c6988e34d33a7c5d5b79c0bcc14da719
virtio: fix freeing of virtio ring buffer

If the allocation if the bounce buffer fails, virtio_free_pages is called
with a random value from the stack.

Ensure that vring.size is initialized.

Fixes: 37e53db38bdb ("virtio: Allocate bounce buffers for devices with VIRTIO_F_IOMMU_PLATFORM")
Addresses-Coverity-ID: 453314 Uninitialized scalar variable
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
drivers/virtio/virtio_ring.c