aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/block/loop.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index a076a14ca72d..cbf7052d1dd5 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1691,6 +1691,9 @@ static int __init loop_init(void)
1691 if (max_part > 0) 1691 if (max_part > 0)
1692 part_shift = fls(max_part); 1692 part_shift = fls(max_part);
1693 1693
1694 if ((1UL << part_shift) > DISK_MAX_PARTS)
1695 return -EINVAL;
1696
1694 if (max_loop > 1UL << (MINORBITS - part_shift)) 1697 if (max_loop > 1UL << (MINORBITS - part_shift))
1695 return -EINVAL; 1698 return -EINVAL;
1696 1699