[lkml]   [2015]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 3.19 19/75] virtio_balloon: set DRIVER_OK before using device
3.19-stable review patch.  If anyone has any objections, please let me know.


From: "Michael S. Tsirkin" <>

commit 88660f7fb94cda1f8f63ee92bfcd0db39a6361e2 upstream.

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 <>
Signed-off-by: Rusty Russell <>
Signed-off-by: Greg Kroah-Hartman <>

drivers/virtio/virtio_balloon.c | 2 ++
1 file changed, 2 insertions(+)

--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -494,6 +494,8 @@ static int virtballoon_probe(struct virt
if (err < 0)
goto out_oom_notify;

+ virtio_device_ready(vdev);
vb->thread = kthread_run(balloon, vb, "vballoon");
if (IS_ERR(vb->thread)) {
err = PTR_ERR(vb->thread);

 \ /
  Last update: 2015-04-10 16:01    [W:0.522 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site