Skip to content

Commit

Permalink
mmc: Fix crash in mmc_block on 64-bit
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ben Collins authored and Linus Torvalds committed Jun 5, 2008
1 parent b2ab26a commit 203c801
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 203c801

Please sign in to comment.