diff options
author | Jens Axboe <axboe@kernel.dk> | 2023-01-04 18:51:19 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2023-01-04 19:05:23 +0300 |
commit | 613b14884b8595e20b9fac4126bf627313827fbe (patch) | |
tree | c779b681aaaeb9854bc310c3a618b8c72f376686 /block/blk-mq.c | |
parent | 1551ed5a178ca030adc92b1eb29157b5e92bf134 (diff) | |
download | linux-613b14884b8595e20b9fac4126bf627313827fbe.tar.xz |
block: handle bio_split_to_limits() NULL return
This can't happen right now, but in preparation for allowing
bio_split_to_limits() returning NULL if it ended the bio, check for it
in all the callers.
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/blk-mq.c')
-rw-r--r-- | block/blk-mq.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/block/blk-mq.c b/block/blk-mq.c index c5cf0dbca1db..2c49b4151da1 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2951,8 +2951,11 @@ void blk_mq_submit_bio(struct bio *bio) blk_status_t ret; bio = blk_queue_bounce(bio, q); - if (bio_may_exceed_limits(bio, &q->limits)) + if (bio_may_exceed_limits(bio, &q->limits)) { bio = __bio_split_to_limits(bio, &q->limits, &nr_segs); + if (!bio) + return; + } if (!bio_integrity_prep(bio)) return; |