diff options
author | Jens Axboe <axboe@fb.com> | 2015-03-05 09:46:13 -0500 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-03-05 09:46:13 -0500 |
commit | b8be79b7144527990377cb032feb5220170712b3 (patch) | |
tree | 0e4073080e36e605cf720548b77f576b44323ee9 | |
parent | 7d70e15480c0450d2bfafaad338a32e884fc215e (diff) | |
parent | ff6b8090e26ef7649ef0cc6b42389141ef48b0cf (diff) |
Merge tag 'nbd_fixes_20150305' of git://git.pengutronix.de/git/mpa/linux-nbd into for-linus
NBD fixes based on v4.0-rc1
-rw-r--r-- | drivers/block/nbd.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c index 4bc2a5cb9935..a98c41f72c63 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c | |||
@@ -803,10 +803,6 @@ static int __init nbd_init(void) | |||
803 | return -EINVAL; | 803 | return -EINVAL; |
804 | } | 804 | } |
805 | 805 | ||
806 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
807 | if (!nbd_dev) | ||
808 | return -ENOMEM; | ||
809 | |||
810 | part_shift = 0; | 806 | part_shift = 0; |
811 | if (max_part > 0) { | 807 | if (max_part > 0) { |
812 | part_shift = fls(max_part); | 808 | part_shift = fls(max_part); |
@@ -828,6 +824,10 @@ static int __init nbd_init(void) | |||
828 | if (nbds_max > 1UL << (MINORBITS - part_shift)) | 824 | if (nbds_max > 1UL << (MINORBITS - part_shift)) |
829 | return -EINVAL; | 825 | return -EINVAL; |
830 | 826 | ||
827 | nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); | ||
828 | if (!nbd_dev) | ||
829 | return -ENOMEM; | ||
830 | |||
831 | for (i = 0; i < nbds_max; i++) { | 831 | for (i = 0; i < nbds_max; i++) { |
832 | struct gendisk *disk = alloc_disk(1 << part_shift); | 832 | struct gendisk *disk = alloc_disk(1 << part_shift); |
833 | if (!disk) | 833 | if (!disk) |