summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-03-05 17:46:13 +0300
committerJens Axboe <axboe@fb.com>2015-03-05 17:46:13 +0300
commitb8be79b7144527990377cb032feb5220170712b3 (patch)
tree0e4073080e36e605cf720548b77f576b44323ee9 /drivers/block
parent7d70e15480c0450d2bfafaad338a32e884fc215e (diff)
parentff6b8090e26ef7649ef0cc6b42389141ef48b0cf (diff)
downloadlinux-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.c8
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)
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)