
From: Alasdair G Kergon <agk@redhat.com>

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

Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/drivers/md/dm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/md/dm.c~device-mapper-fix-minor-number-check drivers/md/dm.c
--- 25/drivers/md/dm.c~device-mapper-fix-minor-number-check	Tue Sep 21 14:22:53 2004
+++ 25-akpm/drivers/md/dm.c	Tue Sep 21 14:22:53 2004
@@ -647,7 +647,7 @@ static int specific_minor(unsigned int m
 {
 	int r, m;
 
-	if (minor > (1 << MINORBITS))
+	if (minor >= (1 << MINORBITS))
 		return -EINVAL;
 
 	down(&_minor_lock);
@@ -697,7 +697,7 @@ static int next_free_minor(unsigned int 
 		goto out;
 	}
 
-	if (m > (1 << MINORBITS)) {
+	if (m >= (1 << MINORBITS)) {
 		idr_remove(&_minor_idr, m);
 		r = -ENOSPC;
 		goto out;
_
