Re: [PATCH] virtio: make PCI devices take a virtio_pci module ref

Jiri Slaby
2008-12-04T22:52:18Z

On 12/04/2008 01:44 PM, Mark McLoughlin wrote:
> Nothing takes a ref on virtio_pci, so even if you have
> devices in use, rmmod will attempt to unload the module.

It unbinds the device properly as any other driver. So what's the problem here?

> Fix by simply making each device take a ref on the module.
>
> Signed-off-by: Mark McLoughlin <markmc@redhat.com>
> Reported-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> drivers/virtio/virtio_pci.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)