]> git.baikalelectronics.ru Git - kernel.git/commit
nbd: blk_mq_init_queue returns an error code on failure, not NULL
authorJeff Moyer <jmoyer@redhat.com>
Mon, 9 Jan 2017 20:20:31 +0000 (15:20 -0500)
committerJens Axboe <axboe@fb.com>
Tue, 10 Jan 2017 20:30:50 +0000 (13:30 -0700)
commita2d26339bc37fb89bb61a4314312a6b72080a9fd
tree2a499c0910f948316a23003cacc43a29619299a5
parentf0f78972989d73fce35c4af2127e5138e7f92f99
nbd: blk_mq_init_queue returns an error code on failure, not NULL

Additionally, don't assign directly to disk->queue, otherwise
blk_put_queue (called via put_disk) will choke (panic) on the errno
stored there.

Bug found by code inspection after Omar found a similar issue in
virtio_blk.  Compile-tested only.

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
Reviewed-by: Omar Sandoval <osandov@fb.com>
Reviewed-by: Josef Bacik <jbacik@fb.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
drivers/block/nbd.c