X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=block%2Fioctl.c;h=d5f5cd61efd7fc738644432d220268f59d5f38ab;hb=577209e844bf0e879f6bff128d4d80f0a5fd8ace;hp=648670ddb164a06eeeebe429de59e5de1a969ec6;hpb=9277abd2c17272ed8fc1b842d9efa45797435b77;p=platform%2Fkernel%2Flinux-starfive.git diff --git a/block/ioctl.c b/block/ioctl.c index 648670d..d5f5cd6 100644 --- a/block/ioctl.c +++ b/block/ioctl.c @@ -20,6 +20,8 @@ static int blkpg_do_ioctl(struct block_device *bdev, struct blkpg_partition p; long long start, length; + if (disk->flags & GENHD_FL_NO_PART) + return -EINVAL; if (!capable(CAP_SYS_ADMIN)) return -EACCES; if (copy_from_user(&p, upart, sizeof(struct blkpg_partition)))