diff options
Diffstat (limited to 'block')
-rw-r--r-- | block/ioctl.c | 5 |
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 | |||
17 | long long start, length; | 17 | long long start, length; |
18 | int part; | 18 | int part; |
19 | int i; | 19 | int i; |
20 | int err; | ||
20 | 21 | ||
21 | if (!capable(CAP_SYS_ADMIN)) | 22 | if (!capable(CAP_SYS_ADMIN)) |
22 | return -EACCES; | 23 | return -EACCES; |
@@ -61,9 +62,9 @@ static int blkpg_ioctl(struct block_device *bdev, struct blkpg_ioctl_arg __user | |||
61 | } | 62 | } |
62 | } | 63 | } |
63 | /* all seems OK */ | 64 | /* all seems OK */ |
64 | add_partition(disk, part, start, length, ADDPART_FLAG_NONE); | 65 | err = add_partition(disk, part, start, length, ADDPART_FLAG_NONE); |
65 | mutex_unlock(&bdev->bd_mutex); | 66 | mutex_unlock(&bdev->bd_mutex); |
66 | return 0; | 67 | return err; |
67 | case BLKPG_DEL_PARTITION: | 68 | case BLKPG_DEL_PARTITION: |
68 | if (!disk->part[part-1]) | 69 | if (!disk->part[part-1]) |
69 | return -ENXIO; | 70 | return -ENXIO; |