summaryrefslogtreecommitdiffstats
path: root/block
diff options
context:
space:
mode:
authorAbdel Benamrouche <draconux@gmail.com>2008-07-25 01:48:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-25 10:53:44 -0700
commit04ebd4aee52b06a2c38127d9208546e5b96f3a19 (patch)
tree25014f06e7bf53ec0b51d717a6a8d0cfb545d985 /block
parentd805dda412346225a50af2d399d958a4bc676c38 (diff)
downloadlinux-04ebd4aee52b06a2c38127d9208546e5b96f3a19.tar.bz2
block/ioctl.c and fs/partition/check.c: check value returned by add_partition()
Now that add_partition() has been aught to propagate errors, let's check them. [akpm@linux-foundation.org: coding-style fixes] Signed-off-by: Abdel Benamrouche <draconux@gmail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'block')
-rw-r--r--block/ioctl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/block/ioctl.c b/block/ioctl.c
index 52d6385216ad..77185e5c026a 100644
--- a/block/ioctl.c
+++ b/block/ioctl.c
@@ -17,6 +17,7 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
long long start, length;
int part;
int i;
+ int err;
if (!capable(CAP_SYS_ADMIN))
return -EACCES;
@@ -61,9 +62,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user
}
}
/* all seems OK */
- add_partition(disk, part, start, length, ADDPART_FLAG_NONE);
+ err = add_partition(disk, part, start, length, ADDPART_FLAG_NONE);
mutex_unlock(&bdev->bd_mutex);
- return 0;
+ return err;
case BLKPG_DEL_PARTITION:
if (!disk->part[part-1])
return -ENXIO;