Skip to content

Commit

Permalink
block: get rid of useless goto and label in blk_mq_get_new_requests()
Browse files Browse the repository at this point in the history
Expected case is returning a request, just check for success and return
the request rather than having an error label.

Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
axboe committed Dec 2, 2021
1 parent 18d7817 commit 373b541
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -2720,11 +2720,8 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
}

rq = __blk_mq_alloc_requests(&data);
if (!rq)
goto fail;
return rq;

fail:
if (rq)
return rq;
rq_qos_cleanup(q, bio);
if (bio->bi_opf & REQ_NOWAIT)
bio_wouldblock_error(bio);
Expand Down

0 comments on commit 373b541

Please sign in to comment.