Commit 65e93ec
virtio-mmio: fix device release warning on module unload
commit c687bc3 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: 81a054c ("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>1 parent 075bc3c commit 65e93ec
1 file changed
Lines changed: 13 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
662 | 662 | | |
663 | 663 | | |
664 | 664 | | |
665 | | - | |
666 | | - | |
667 | | - | |
| 665 | + | |
668 | 666 | | |
669 | 667 | | |
670 | 668 | | |
671 | 669 | | |
672 | 670 | | |
673 | 671 | | |
674 | 672 | | |
675 | | - | |
676 | 673 | | |
677 | 674 | | |
678 | 675 | | |
| |||
704 | 701 | | |
705 | 702 | | |
706 | 703 | | |
707 | | - | |
708 | | - | |
709 | | - | |
| 704 | + | |
| 705 | + | |
710 | 706 | | |
711 | | - | |
| 707 | + | |
712 | 708 | | |
713 | 709 | | |
714 | 710 | | |
| |||
719 | 715 | | |
720 | 716 | | |
721 | 717 | | |
722 | | - | |
| 718 | + | |
723 | 719 | | |
724 | 720 | | |
725 | 721 | | |
| |||
743 | 739 | | |
744 | 740 | | |
745 | 741 | | |
746 | | - | |
747 | | - | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
| |||
766 | 766 | | |
767 | 767 | | |
768 | 768 | | |
769 | | - | |
| 769 | + | |
770 | 770 | | |
771 | | - | |
| 771 | + | |
772 | 772 | | |
773 | 773 | | |
774 | 774 | | |
| |||
0 commit comments