]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
cciss: Handle failure of blk_init_queue gracefully in cciss_add_disk.
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 17 Sep 2009 18:47:24 +0000 (13:47 -0500)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 1 Oct 2009 19:15:42 +0000 (21:15 +0200)
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>
drivers/block/cciss.c

index 2810dd9805a9d706c462834ddc7758db66794d59..b1211d530dae1e01d935eaa8bcec79fa30773371 100644 (file)
@@ -1690,6 +1690,8 @@ static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
                                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 @@ static int cciss_add_disk(ctlr_info_t *h, struct gendisk *disk,
 cleanup_queue:
        blk_cleanup_queue(disk->queue);
        disk->queue = NULL;
+init_queue_failure:
        return -1;
 }