mmc: Fix crash in mmc_block on 64-bit
authorBen Collins <ben.collins@canonical.com>
Thu, 5 Jun 2008 23:10:21 +0000 (19:10 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 5 Jun 2008 23:14:17 +0000 (16:14 -0700)
Fairly simple. "dev_use" was being allocated as a zero length array
because of bad math on 64-bit systems, causing a crash in
find_first_zero_bit(). One-liner follows:

Signed-off-by: Ben Collins <ben.collins@canonical.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/mmc/card/block.c

index 91ded3e82401a5ccb6d59e4d454de95914f4fbf7..f9ad960d7c1a61305e6f3f1841bc0e8437048a18 100644 (file)
@@ -46,7 +46,7 @@
 #define MMC_SHIFT      3
 #define MMC_NUM_MINORS (256 >> MMC_SHIFT)
 
-static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];
+static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS);
 
 /*
  * There is one mmc_blk_data per slot.