X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=block%2Fioctl.c;h=d5f5cd61efd7fc738644432d220268f59d5f38ab;hb=ce55c22ec8b223a90ff3e084d842f73cfba35588;hp=648670ddb164a06eeeebe429de59e5de1a969ec6;hpb=e3b85b07650c0c9d4d2fab82a21fa3dfbfbb9b63;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)))