public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] FIx crash in mmc_block on 64-bit
@ 2008-06-02 17:39 Ben Collins
  2008-06-05 21:25 ` Pierre Ossman
  0 siblings, 1 reply; 3+ messages in thread
From: Ben Collins @ 2008-06-02 17:39 UTC (permalink / raw)
  To: kernel list; +Cc: drzeus-mmc, kernel-team

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.



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] FIx crash in mmc_block on 64-bit
  2008-06-02 17:39 [PATCH] FIx crash in mmc_block on 64-bit Ben Collins
@ 2008-06-05 21:25 ` Pierre Ossman
  2008-06-05 23:11   ` Ben Collins
  0 siblings, 1 reply; 3+ messages in thread
From: Pierre Ossman @ 2008-06-05 21:25 UTC (permalink / raw)
  To: Ben Collins; +Cc: kernel list, kernel-team

On Mon, 02 Jun 2008 13:39:19 -0400
Ben Collins <ben.collins@canonical.com> wrote:

> 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:
> 

A signed-off-by to make things nice and proper, please. :)

You can add an Acked-by: Pierre Ossman <drzeus@drzeus.cx> and pass it
on directly to Linus.

Rgds
-- 
     -- Pierre Ossman

  Linux kernel, MMC maintainer        http://www.kernel.org
  rdesktop, core developer          http://www.rdesktop.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] FIx crash in mmc_block on 64-bit
  2008-06-05 21:25 ` Pierre Ossman
@ 2008-06-05 23:11   ` Ben Collins
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Collins @ 2008-06-05 23:11 UTC (permalink / raw)
  To: Pierre Ossman; +Cc: kernel list, kernel-team

On Thu, 2008-06-05 at 23:25 +0200, Pierre Ossman wrote:
> On Mon, 02 Jun 2008 13:39:19 -0400
> Ben Collins <ben.collins@canonical.com> wrote:
> 
> > 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:
> > 
> 
> A signed-off-by to make things nice and proper, please. :)
> 
> You can add an Acked-by: Pierre Ossman <drzeus@drzeus.cx> and pass it
> on directly to Linus.

Not sure how I missed the signed-off-by, but resent to Linus with your
ack. Thanks


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-05 23:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-02 17:39 [PATCH] FIx crash in mmc_block on 64-bit Ben Collins
2008-06-05 21:25 ` Pierre Ossman
2008-06-05 23:11   ` Ben Collins

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox