cciss: Handle failure of blk_init_queue gracefully in cciss_add_disk.
Handle failure of blk_init_queue gracefully in cciss_add_disk.
Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 2810dd9..b1211d530 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1690,6 +1690,8 @@
int drv_index)
{
disk->queue = blk_init_queue(do_cciss_request, &h->lock);
+ if (!disk->queue)
+ goto init_queue_failure;
sprintf(disk->disk_name, "cciss/c%dd%d", h->ctlr, drv_index);
disk->major = h->major;
disk->first_minor = drv_index << NWD_SHIFT;
@@ -1730,6 +1732,7 @@
cleanup_queue:
blk_cleanup_queue(disk->queue);
disk->queue = NULL;
+init_queue_failure:
return -1;
}