[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1212428359.7239.4.camel@cunning>
Date: Mon, 02 Jun 2008 13:39:19 -0400
From: Ben Collins <ben.collins@...onical.com>
To: kernel list <linux-kernel@...r.kernel.org>
Cc: drzeus-mmc@...eus.cx, kernel-team <kernel-team@...ts.ubuntu.com>
Subject: [PATCH] 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:
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.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists