packet: Move reference count in packet_sock to atomic_long_t
[platform/kernel/linux-starfive.git] / block / ioctl.c
index 648670d..d5f5cd6 100644 (file)
@@ -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)))