Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 108939
b: refs/heads/master
c: f3944d6
h: refs/heads/master
i:
  108937: db0ad1e
  108935: 164eb83
v: v3
  • Loading branch information
Sven Wegener authored and Linus Torvalds committed Aug 20, 2008
1 parent 5b9d422 commit ff90c68
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 759f9a2df78d2156a2675edc7999fb4c919a3159
refs/heads/master: f3944d61ddc65722539ffd7b6f5b7c7217c136cc
10 changes: 6 additions & 4 deletions trunk/drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -707,15 +707,15 @@ static int __init nbd_init(void)

BUILD_BUG_ON(sizeof(struct nbd_request) != 28);

nbd_dev = kcalloc(nbds_max, sizeof(*nbd_dev), GFP_KERNEL);
if (!nbd_dev)
return -ENOMEM;

if (max_part < 0) {
printk(KERN_CRIT "nbd: max_part must be >= 0\n");
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);
Expand Down Expand Up @@ -779,6 +779,7 @@ static int __init nbd_init(void)
blk_cleanup_queue(nbd_dev[i].disk->queue);
put_disk(nbd_dev[i].disk);
}
kfree(nbd_dev);
return err;
}

Expand All @@ -795,6 +796,7 @@ static void __exit nbd_cleanup(void)
}
}
unregister_blkdev(NBD_MAJOR, "nbd");
kfree(nbd_dev);
printk(KERN_INFO "nbd: unregistered device at major %d\n", NBD_MAJOR);
}

Expand Down

0 comments on commit ff90c68

Please sign in to comment.