diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-18 08:07:51 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-18 08:07:51 -0800 |
commit | 7f0f598a0069d1ab072375965a4b69137233169c (patch) | |
tree | 00cb9320e0caef179d6075b54fa611de6551e3e2 /block/ioctl.c | |
parent | a6a0c4ca7edb378a8a7332501f097089cb1051c4 (diff) | |
parent | c26156b2534c75bb3cdedf76f6ad1340971cf5bd (diff) |
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
block: hold extra reference to bio in blk_rq_map_user_iov()
relay: fix cpu offline problem
Release old elevator on change elevator
block: fix boot failure with CONFIG_DEBUG_BLOCK_EXT_DEVT=y and nash
block/md: fix md autodetection
block: make add_partition() return pointer to hd_struct
block: fix add_partition() error path
Diffstat (limited to 'block/ioctl.c')
-rw-r--r-- | block/ioctl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/block/ioctl.c b/block/ioctl.c index c832d639b6e..d03985b04d6 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -18,7 +18,6 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user struct disk_part_iter piter; long long start, length; int partno; - int err; if (!capable(CAP_SYS_ADMIN)) return -EACCES; @@ -61,10 +60,10 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user disk_part_iter_exit(&piter); /* all seems OK */ - err = add_partition(disk, partno, start, length, - ADDPART_FLAG_NONE); + part = add_partition(disk, partno, start, length, + ADDPART_FLAG_NONE); mutex_unlock(&bdev->bd_mutex); - return err; + return IS_ERR(part) ? PTR_ERR(part) : 0; case BLKPG_DEL_PARTITION: part = disk_get_part(disk, partno); if (!part) |