[PATCH] device-mapper: fix minor number check

From: Alasdair G Kergon
Date: Tue Sep 21 2004 - 11:22:38 EST


Fix minor number allocation check: (1 << MINORBITS) is invalid.

--- diff/drivers/md/dm.c 2004-09-20 20:44:03.000000000 +0100
+++ source/drivers/md/dm.c 2004-09-21 16:34:04.000000000 +0100
@@ -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;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/