X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=block%2Fioctl.c;h=d03985b04d6768bd0966c3c75f27b6a1336ede1b;hb=8ebcfc8bcb55261cf01fc302d707fbba46242bf1;hp=c832d639b6e254eb375d9c69504172182ab14c4d;hpb=1f6d6e8ebe73ba9d9d4c693f7f6f50f661dbd6e4;p=linux-2.6-omap-h63xx.git 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)