device-mapper: fix minor number check
Alasdair G Kergon
maintainerPATCH 1/1 device-mapper: fix minor number check
Fix minor number allocation check: (1 << MINORBITS) is invalid.
drivers/md/dm.c +2 -2
@@ -647,7 +647,7 @@ {int r, m; -if (minor > (1 <<MINORBITS )) +if (minor >= (1 <<MINORBITS ))return -EINVAL ;down (&_minor_lock);
@@ -697,7 +697,7 @@ goto out; } -if (m > (1 <<MINORBITS )) { +if (m >= (1 <<MINORBITS )) {idr_remove (&_minor_idr, m); r = -ENOSPC ; goto out;