linux/drivers/virtio
Johan Hovold 20bbc1e187 virtio-mmio: fix device release warning on module unload
commit c687bc3569 upstream.

Driver core expects devices to be allocated dynamically and complains
loudly when a device that lacks a release function is freed.

Use __root_device_register() to allocate and register the root device
instead of open coding using a static device.

Note that root_device_register(), which also creates a link to the
module, cannot be used as the device is registered when parsing the
module parameters which happens before the module kobject has been set
up.

Fixes: 81a054ce0b ("virtio-mmio: Devices parameter parsing")
Cc: stable@vger.kernel.org	# 3.5
Cc: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260427143710.14702-1-johan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2026-07-24 15:51:20 +02:00
..
Kconfig virtio-pci: introduce modern device module 2021-02-23 07:52:58 -05:00
Makefile virtio-pci: introduce modern device module 2021-02-23 07:52:58 -05:00
virtio.c virtio: reenable config if freezing device failed 2024-04-13 13:01:47 +02:00
virtio_balloon.c mm/balloon_compaction: convert balloon_page_delete() to balloon_page_finalize() 2026-01-19 13:10:10 +01:00
virtio_dma_buf.c virtio: fix build for configs without dma-bufs 2020-08-19 06:43:28 +02:00
virtio_input.c virtio-input: add multi-touch support 2021-02-23 07:52:59 -05:00
virtio_mem.c virtio/virtio_mem: handle a possible NULL as a memcpy parameter 2022-01-27 11:02:59 +01:00
virtio_mmio.c virtio-mmio: fix device release warning on module unload 2026-07-24 15:51:20 +02:00
virtio_pci_common.c virtio: delete vq in vp_find_vqs_msix() when request_irq() fails 2024-06-16 13:39:47 +02:00
virtio_pci_common.h virtio-pci: introduce modern device module 2021-02-23 07:52:58 -05:00
virtio_pci_legacy.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 78 2019-05-24 17:37:51 +02:00
virtio_pci_modern.c virtio_pci: modify ENOENT to EINVAL 2023-01-24 07:22:41 +01:00
virtio_pci_modern_dev.c virtio: pci: Fix an error handling path in vp_modern_probe() 2022-06-14 18:36:12 +02:00
virtio_ring.c virtio_ring: Fix data race by tagging event_triggered as racy for KCSAN 2025-06-04 14:37:54 +02:00
virtio_vdpa.c virtio_vdpa: fix misleading return in void function 2026-01-19 13:09:35 +01:00