diff options
author | Heinz Graalfs <graalfs@linux.vnet.ibm.com> | 2013-10-29 09:40:30 +1030 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2013-10-29 11:28:17 +1030 |
commit | 7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab (patch) | |
tree | 338af05a9b2456350b84858b314d101c9c71fc5a /drivers | |
parent | b3b32c94133621c9ba7e4c8f29ec7533f2f4d8ec (diff) | |
download | op-kernel-dev-7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab.zip op-kernel-dev-7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab.tar.gz |
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')
-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 6b66252..f3be496 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) |