Skip to content

Commit 203c801

Browse files
Ben Collinstorvalds
authored andcommitted
mmc: Fix crash in mmc_block on 64-bit
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 <[email protected]> Acked-by: Pierre Ossman <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent b2ab26a commit 203c801

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/mmc/card/block.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#define MMC_SHIFT 3
4747
#define MMC_NUM_MINORS (256 >> MMC_SHIFT)
4848

49-
static unsigned long dev_use[MMC_NUM_MINORS/(8*sizeof(unsigned long))];
49+
static DECLARE_BITMAP(dev_use, MMC_NUM_MINORS);
5050

5151
/*
5252
* There is one mmc_blk_data per slot.

0 commit comments

Comments
 (0)