diff options
author | Jens Axboe <axboe@fb.com> | 2015-03-05 14:46:13 (GMT) |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-03-05 14:46:13 (GMT) |
commit | b8be79b7144527990377cb032feb5220170712b3 (patch) | |
tree | 0e4073080e36e605cf720548b77f576b44323ee9 /drivers/block | |
parent | 7d70e15480c0450d2bfafaad338a32e884fc215e (diff) | |
parent | ff6b8090e26ef7649ef0cc6b42389141ef48b0cf (diff) | |
download | linux-b8be79b7144527990377cb032feb5220170712b3.tar.xz |
Merge tag 'nbd_fixes_20150305' of git://git.pengutronix.de/git/mpa/linux-nbd into for-linus
NBD fixes based on v4.0-rc1
Diffstat (limited to 'drivers/block')
-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 4bc2a5c..a98c41f 100644 --- a/drivers/block/nbd.c +++ b/drivers/block/nbd.c @@ -803,10 +803,6 @@ static int __init nbd_init(void) return -EINVAL; } - nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); - if (!nbd_dev) - return -ENOMEM; - part_shift = 0; if (max_part > 0) { part_shift = fls(max_part); @@ -828,6 +824,10 @@ static int __init nbd_init(void) if (nbds_max > 1UL << (MINORBITS - part_shift)) return -EINVAL; + nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL); + if (!nbd_dev) + return -ENOMEM; + for (i = 0; i < nbds_max; i++) { struct gendisk *disk = alloc_disk(1 << part_shift); if (!disk) |