Skip to content
Commit 24516565 authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

blk-mq: fix NULL dereference on q->elevator in blk_mq_elv_switch_none



After grabbing q->sysfs_lock, q->elevator may become NULL because of
elevator switch.

Fix the NULL dereference on q->elevator by checking it with lock.

Reported-by: default avatarGuangwu Zhang <guazhang@redhat.com>
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20230616132354.415109-1-ming.lei@redhat.com


Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 84bd06c6
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment