diff options
author | Ingo Molnar <mingo@elte.hu> | 2008-08-25 04:54:07 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-08-25 04:54:07 -0400 |
commit | e4f807c2b4d81636fc63993368646c5bfd42b22f (patch) | |
tree | 2ff100911b1ba4e26e3d9aad41edb9b48405f01e /drivers/block | |
parent | 25258ef762bc4a05fa9c4523f7dae56e3fd01864 (diff) | |
parent | 83097aca8567a0bd593534853b71fe0fa9a75d69 (diff) |
Merge branch 'linus' into x86/xen
Conflicts:
arch/x86/kernel/paravirt.c
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/brd.c | 2 | ||||
-rw-r--r-- | drivers/block/nbd.c | 10 |
2 files changed, 7 insertions, 5 deletions
diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 24b97b0bef99..d070d492e385 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c | |||
@@ -571,8 +571,8 @@ out_free: | |||
571 | list_del(&brd->brd_list); | 571 | list_del(&brd->brd_list); |
572 | brd_free(brd); | 572 | brd_free(brd); |
573 | } | 573 | } |
574 | unregister_blkdev(RAMDISK_MAJOR, "ramdisk"); | ||
574 | 575 | ||
575 | unregister_blkdev(RAMDISK_MAJOR, "brd"); | ||
576 | return -ENOMEM; | 576 | return -ENOMEM; |
577 | } | 577 | } |
578 | 578 | ||
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index ad98dda6037d..1778e4a2c672 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -707,15 +707,15 @@ static int __init nbd_init(void) | |||
707 | 707 | ||
708 | BUILD_BUG_ON(sizeof(struct nbd_request) != 28); | 708 | BUILD_BUG_ON(sizeof(struct nbd_request) != 28); |
709 | 709 | ||
710 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
711 | if (!nbd_dev) | ||
712 | return -ENOMEM; | ||
713 | |||
714 | if (max_part < 0) { | 710 | if (max_part < 0) { |
715 | printk(KERN_CRIT "nbd: max_part must be >= 0\n"); | 711 | printk(KERN_CRIT "nbd: max_part must be >= 0\n"); |
716 | return -EINVAL; | 712 | return -EINVAL; |
717 | } | 713 | } |
718 | 714 | ||
715 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
716 | if (!nbd_dev) | ||
717 | return -ENOMEM; | ||
718 | |||
719 | part_shift = 0; | 719 | part_shift = 0; |
720 | if (max_part > 0) | 720 | if (max_part > 0) |
721 | part_shift = fls(max_part); | 721 | part_shift = fls(max_part); |
@@ -779,6 +779,7 @@ out: | |||
779 | blk_cleanup_queue(nbd_dev[i].disk->queue); | 779 | blk_cleanup_queue(nbd_dev[i].disk->queue); |
780 | put_disk(nbd_dev[i].disk); | 780 | put_disk(nbd_dev[i].disk); |
781 | } | 781 | } |
782 | kfree(nbd_dev); | ||
782 | return err; | 783 | return err; |
783 | } | 784 | } |
784 | 785 | ||
@@ -795,6 +796,7 @@ static void __exit nbd_cleanup(void) | |||
795 | } | 796 | } |
796 | } | 797 | } |
797 | unregister_blkdev(NBD_MAJOR, "nbd"); | 798 | unregister_blkdev(NBD_MAJOR, "nbd"); |
799 | kfree(nbd_dev); | ||
798 | printk(KERN_INFO "nbd: unregistered device at major %d\n", NBD_MAJOR); | 800 | printk(KERN_INFO "nbd: unregistered device at major %d\n", NBD_MAJOR); |
799 | } | 801 | } |
800 | 802 | ||