diff options
Diffstat (limited to 'drivers/block/rd.c')
-rw-r--r-- | drivers/block/rd.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/block/rd.c b/drivers/block/rd.c index a3f64bfe6b58..485aa87e9bcd 100644 --- a/drivers/block/rd.c +++ b/drivers/block/rd.c | |||
@@ -432,6 +432,12 @@ static int __init rd_init(void) | |||
432 | rd_disks[i] = alloc_disk(1); | 432 | rd_disks[i] = alloc_disk(1); |
433 | if (!rd_disks[i]) | 433 | if (!rd_disks[i]) |
434 | goto out; | 434 | goto out; |
435 | |||
436 | rd_queue[i] = blk_alloc_queue(GFP_KERNEL); | ||
437 | if (!rd_queue[i]) { | ||
438 | put_disk(rd_disks[i]); | ||
439 | goto out; | ||
440 | } | ||
435 | } | 441 | } |
436 | 442 | ||
437 | if (register_blkdev(RAMDISK_MAJOR, "ramdisk")) { | 443 | if (register_blkdev(RAMDISK_MAJOR, "ramdisk")) { |
@@ -442,10 +448,6 @@ static int __init rd_init(void) | |||
442 | for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { | 448 | for (i = 0; i < CONFIG_BLK_DEV_RAM_COUNT; i++) { |
443 | struct gendisk *disk = rd_disks[i]; | 449 | struct gendisk *disk = rd_disks[i]; |
444 | 450 | ||
445 | rd_queue[i] = blk_alloc_queue(GFP_KERNEL); | ||
446 | if (!rd_queue[i]) | ||
447 | goto out_queue; | ||
448 | |||
449 | blk_queue_make_request(rd_queue[i], &rd_make_request); | 451 | blk_queue_make_request(rd_queue[i], &rd_make_request); |
450 | blk_queue_hardsect_size(rd_queue[i], rd_blocksize); | 452 | blk_queue_hardsect_size(rd_queue[i], rd_blocksize); |
451 | 453 | ||
@@ -466,8 +468,6 @@ static int __init rd_init(void) | |||
466 | CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize); | 468 | CONFIG_BLK_DEV_RAM_COUNT, rd_size, rd_blocksize); |
467 | 469 | ||
468 | return 0; | 470 | return 0; |
469 | out_queue: | ||
470 | unregister_blkdev(RAMDISK_MAJOR, "ramdisk"); | ||
471 | out: | 471 | out: |
472 | while (i--) { | 472 | while (i--) { |
473 | put_disk(rd_disks[i]); | 473 | put_disk(rd_disks[i]); |