summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-11-09 06:47:55 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2012-11-09 06:47:55 +0100
commitcdfe1565c094f60fef00238884aff2c781dd0784 (patch)
tree2abc7568246a5d4b145072144bfd938f6b47c9fb /drivers
parenta601e63717a269b9171a7164ab9e285788362d1b (diff)
parent237242bddc99041e15a4ca51b8439657cadaff17 (diff)
Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio and module fixes from Rusty Russell: "YA module signing build tweak, and two cc'd to stable." * tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: virtio: Don't access index after unregister. modules: don't break modules_install on external modules with no key. module: fix out-by-one error in kallsyms
Diffstat (limited to 'drivers')
-rw-r--r--drivers/virtio/virtio.c4
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);
void unregister_virtio_device(struct virtio_device *dev)
{
+ int index = dev->index; /* save for after device release */
+
device_unregister(&dev->dev);
- ida_simple_remove(&virtio_index_ida, dev->index);
+ ida_simple_remove(&virtio_index_ida, index);
}
EXPORT_SYMBOL_GPL(unregister_virtio_device);