diff options
author | Jens Axboe <axboe@fb.com> | 2015-03-13 08:24:49 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-03-13 08:24:49 -0600 |
commit | 64f9b683b6418d946101a9068d133b6daa3a22aa (patch) | |
tree | b3a6bc7255631c4f1c270b1d2123b362689f9a61 /drivers | |
parent | c202baf017aea0c860e53131bc55bb1af7177e76 (diff) | |
parent | 9a30b096b543932de218dd3501b5562e00a8792d (diff) | |
download | linux-64f9b683b6418d946101a9068d133b6daa3a22aa.tar.bz2 |
Merge branch 'for-linus' into for-4.1/core
Diffstat (limited to 'drivers')
-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) 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) |