Skip to content

Commit 373b541

Browse files
committed
block: get rid of useless goto and label in blk_mq_get_new_requests()
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]>
1 parent 18d7817 commit 373b541

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

block/blk-mq.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2720,11 +2720,8 @@ static struct request *blk_mq_get_new_requests(struct request_queue *q,
27202720
}
27212721

27222722
rq = __blk_mq_alloc_requests(&data);
2723-
if (!rq)
2724-
goto fail;
2725-
return rq;
2726-
2727-
fail:
2723+
if (rq)
2724+
return rq;
27282725
rq_qos_cleanup(q, bio);
27292726
if (bio->bi_opf & REQ_NOWAIT)
27302727
bio_wouldblock_error(bio);

0 commit comments

Comments
 (0)