diff options
Diffstat (limited to 'drivers/virtio/virtio.c')
-rw-r--r-- | drivers/virtio/virtio.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c index 1e8659ca27ef..809b0de59c09 100644 --- a/drivers/virtio/virtio.c +++ b/drivers/virtio/virtio.c | |||
@@ -225,8 +225,10 @@ EXPORT_SYMBOL_GPL(register_virtio_device); | |||
225 | 225 | ||
226 | void unregister_virtio_device(struct virtio_device *dev) | 226 | void unregister_virtio_device(struct virtio_device *dev) |
227 | { | 227 | { |
228 | int index = dev->index; /* save for after device release */ | ||
229 | |||
228 | device_unregister(&dev->dev); | 230 | device_unregister(&dev->dev); |
229 | ida_simple_remove(&virtio_index_ida, dev->index); | 231 | ida_simple_remove(&virtio_index_ida, index); |
230 | } | 232 | } |
231 | EXPORT_SYMBOL_GPL(unregister_virtio_device); | 233 | EXPORT_SYMBOL_GPL(unregister_virtio_device); |
232 | 234 | ||