aboutsummaryrefslogtreecommitdiff
path: root/drivers/block/nbd.c
diff options
context:
space:
mode:
authorAlex Shi <alex.shi@linaro.org>2015-04-20 13:51:21 +0800
committerAlex Shi <alex.shi@linaro.org>2015-04-20 13:51:21 +0800
commit663276faa26c2837eca83a5800b3668be19aaaff (patch)
treeaee6a1964c83eb2153bde4a4c442af88204a28a8 /drivers/block/nbd.c
parent667ea3959654ae48ef303df13f2635fd07766cb4 (diff)
parent5c43c539346972b9a1d5f38dc62db5a39997488d (diff)
downloadlinux-linaro-stable-663276faa26c2837eca83a5800b3668be19aaaff.tar.gz
Merge tag 'v3.14.39' into linux-linaro-lsk-v3.14
This is the 3.14.39 stable release
Diffstat (limited to 'drivers/block/nbd.c')
-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 55298db36b2d..d18093681af2 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -814,10 +814,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);
@@ -839,6 +835,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)