]> git.ipfire.org Git - people/ms/linux.git/commit
virtio: rng: disallow multiple device registrations, fixes crashes
authorAmit Shah <amit.shah@redhat.com>
Fri, 8 Mar 2013 00:30:18 +0000 (11:30 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Mar 2013 19:58:50 +0000 (12:58 -0700)
commit22220e7c212f7f64d76077c0601139cf0c56255c
treeaed89a25270e03e3d531a28db69f6d5ef6156c66
parent74bb0c4e0d2644b9b070d92e675e6c2d04e5875b
virtio: rng: disallow multiple device registrations, fixes crashes

commit e84e7a56a3aa2963db506299e29a5f3f09377f9b upstream.

The code currently only supports one virtio-rng device at a time.
Invoking guests with multiple devices causes the guest to blow up.

Check if we've already registered and initialised the driver.  Also
cleanup in case of registration errors or hot-unplug so that a new
device can be used.

Reported-by: Peter Krempa <pkrempa@redhat.com>
Reported-by: <yunzheng@redhat.com>
Signed-off-by: Amit Shah <amit.shah@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/char/hw_random/virtio-rng.c