]> git.baikalelectronics.ru Git - kernel.git/commit
virtio_balloon: set DRIVER_OK before using device
authorMichael S. Tsirkin <mst@redhat.com>
Thu, 5 Mar 2015 02:54:41 +0000 (13:24 +1030)
committerRusty Russell <rusty@rustcorp.com.au>
Tue, 10 Mar 2015 01:18:28 +0000 (11:48 +1030)
commite649a00273d138a5aa9c385106bd4f874e1ed172
treedb1aef23fcc5c191a3b4fc1255aee5d46b50558f
parent8b26285d970a943c5db11cddd1b0150ea4672691
virtio_balloon: set DRIVER_OK before using device

virtio spec requires that all drivers set DRIVER_OK
before using devices. While balloon isn't yet
included in the virtio 1 spec, previous spec versions
also required this.

virtio balloon might violate this rule: probe calls
kthread_run before setting DRIVER_OK, which might run
immediately and cause balloon to inflate/deflate.

To fix, call virtio_device_ready before running the kthread.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
drivers/virtio/virtio_balloon.c