netfilter: nft_set_rbtree: skip end interval element from gc
[platform/kernel/linux-starfive.git] / block / partitions / core.c
index e137a87..e58c8b5 100644 (file)
@@ -458,6 +458,11 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start,
                goto out;
        }
 
+       if (disk->flags & GENHD_FL_NO_PART) {
+               ret = -EINVAL;
+               goto out;
+       }
+
        if (partition_overlaps(disk, start, length, -1)) {
                ret = -EBUSY;
                goto out;