]> git.baikalelectronics.ru Git - kernel.git/commit
block: avoid to READ fields of null bio
authorMing Lei <ming.lei@redhat.com>
Tue, 19 Feb 2019 03:08:19 +0000 (11:08 +0800)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Feb 2019 16:19:06 +0000 (09:19 -0700)
commit8e0a550827d64ee2ce43515f035eb9b02f0c6b70
tree52811398366d5cc858edaebe17ca7cb1238a9777
parent930c4a46a1c8c569d3a2b10ecd486cd10652a278
block: avoid to READ fields of null bio

rq->bio can be NULL sometimes, such as flush request, so don't
read bio->bi_seg_front_size until this 'bio' is checked as valid.

Cc: Bart Van Assche <bvanassche@acm.org>
Reported-by: Bart Van Assche <bvanassche@acm.org>
Fixes: dabaa841f49c85632c6f ("block: use bio_for_each_bvec() to compute multi-page bvec count")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c