diff options
author | Heinz Graalfs <graalfs@linux.vnet.ibm.com> | 2013-10-29 03:10:30 +0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-10-29 04:58:17 +0400 |
commit | 7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab (patch) | |
tree | 338af05a9b2456350b84858b314d101c9c71fc5a /drivers/block/virtio_blk.c | |
parent | b3b32c94133621c9ba7e4c8f29ec7533f2f4d8ec (diff) | |
download | linux-7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab.tar.xz |
virtio_blk: verify if queue is broken after virtqueue_get_buf()
In case virtqueue_get_buf() returned with a NULL pointer verify if the
virtqueue is broken in order to leave while loop.
Signed-off-by: Heinz Graalfs <graalfs@linux.vnet.ibm.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Diffstat (limited to 'drivers/block/virtio_blk.c')
-rw-r--r-- | drivers/block/virtio_blk.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 6b66252fc4e6..f3be496ac8fa 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -292,6 +292,8 @@ static void virtblk_done(struct virtqueue *vq) req_done = true; } } + if (unlikely(virtqueue_is_broken(vq))) + break; } while (!virtqueue_enable_cb(vq)); /* In case queue is stopped waiting for more buffers. */ if (req_done) |