diff options
-rw-r--r-- | drivers/block/virtio_blk.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/block/virtio_blk.c b/drivers/block/virtio_blk.c index 9dd0099d2bd2..ec6ed24d1061 100644 --- a/drivers/block/virtio_blk.c +++ b/drivers/block/virtio_blk.c @@ -208,8 +208,9 @@ static void virtblk_cleanup_cmd(struct request *req) kfree(bvec_virt(&req->special_vec)); } -static int virtblk_setup_cmd(struct virtio_device *vdev, struct request *req, - struct virtblk_req *vbr) +static blk_status_t virtblk_setup_cmd(struct virtio_device *vdev, + struct request *req, + struct virtblk_req *vbr) { bool unmap = false; u32 type; @@ -317,14 +318,15 @@ static blk_status_t virtio_queue_rq(struct blk_mq_hw_ctx *hctx, unsigned long flags; unsigned int num; int qid = hctx->queue_num; - int err; bool notify = false; + blk_status_t status; + int err; BUG_ON(req->nr_phys_segments + 2 > vblk->sg_elems); - err = virtblk_setup_cmd(vblk->vdev, req, vbr); - if (unlikely(err)) - return err; + status = virtblk_setup_cmd(vblk->vdev, req, vbr); + if (unlikely(status)) + return status; blk_mq_start_request(req); |