[PATCH] FIx crash in mmc_block on 64-bit

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: kernel list <linux-kernel@...>
Cc: <drzeus-mmc@...>, kernel-team <kernel-team@...>
Date: Monday, June 2, 2008 - 1:39 pm

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:

diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index 91ded3e..f9ad960 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -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.


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] FIx crash in mmc_block on 64-bit, Ben Collins, (Mon Jun 2, 1:39 pm)
Re: [PATCH] FIx crash in mmc_block on 64-bit, Pierre Ossman, (Thu Jun 5, 5:25 pm)
Re: [PATCH] FIx crash in mmc_block on 64-bit, Ben Collins, (Thu Jun 5, 7:11 pm)