block: Make del_gendisk() safer for disks without queues
Commit 165a5e22fafb "block: Move bdi_unregister() to del_gendisk()" added disk->queue dereference to del_gendisk(). Although del_gendisk() is not supposed to be called without disk->queue valid and blk_unregister_queue() warns in that case, this change will make it oops instead. Return to the old more robust behavior of just warning when del_gendisk() gets called for gendisk with disk->queue being NULL. Change-Id: I66abdfd9dc9a9d945aed7f9722b48a77215356b2 Reported-by:Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by:
Jan Kara <jack@suse.cz> Tested-by:
Omar Sandoval <osandov@fb.com> Signed-off-by:
Jens Axboe <axboe@fb.com> Git-commit: 90f16fddcc2802726142b8386c65ccb89f044613 Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git Signed-off-by:
Ritesh Harjani <riteshh@codeaurora.org>
Loading
Please register or sign in to comment