aboutsummaryrefslogtreecommitdiff
path: root/block/ioctl.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2008-12-04 11:05:26 +0100
committerIngo Molnar <mingo@elte.hu>2008-12-04 11:05:26 +0100
commitc0515566f3117c44b0572559bcc3cb00899b0910 (patch)
tree3c7e36ed6e78812b9276a81d6b3a2e80788003c5 /block/ioctl.c
parent4385cecf1f5866fb33fc95e2ee26a44e9b6f6be2 (diff)
parent061e41fdb5047b1fb161e89664057835935ca1d2 (diff)
Merge commit 'v2.6.28-rc7' into x86/cleanups
Diffstat (limited to 'block/ioctl.c')
-rw-r--r--block/ioctl.c7
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)