From: Heinz Graalfs Date: Mon, 28 Oct 2013 23:10:30 +0000 (+1030) Subject: virtio_blk: verify if queue is broken after virtqueue_get_buf() X-Git-Tag: firefly_0821_release~176^2~4969^2~6 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7f03b17d5c3f3b63dcacf0e481cf94c9d07267ab;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Rusty Russell --- 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)