Merge tag 'for-5.18/block-2022-04-01' of git://git.kernel.dk/linux-block
[linux-2.6-microblaze.git] / block / genhd.c
index c9a4fc9..b8b6759 100644 (file)
@@ -335,7 +335,7 @@ int blk_alloc_ext_minor(void)
 {
        int idx;
 
-       idx = ida_alloc_range(&ext_devt_ida, 0, NR_EXT_DEVT, GFP_KERNEL);
+       idx = ida_alloc_range(&ext_devt_ida, 0, NR_EXT_DEVT - 1, GFP_KERNEL);
        if (idx == -ENOSPC)
                return -EBUSY;
        return idx;