From: Ben Collins <ben.collins@canonical.com>
To: kernel list <linux-kernel@vger.kernel.org>
Cc: drzeus-mmc@drzeus.cx, kernel-team <kernel-team@lists.ubuntu.com>
Subject: [PATCH] FIx crash in mmc_block on 64-bit
Date: Mon, 02 Jun 2008 13:39:19 -0400 [thread overview]
Message-ID: <1212428359.7239.4.camel@cunning> (raw)
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.
next reply other threads:[~2008-06-02 18:11 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-02 17:39 Ben Collins [this message]
2008-06-05 21:25 ` [PATCH] FIx crash in mmc_block on 64-bit Pierre Ossman
2008-06-05 23:11 ` Ben Collins
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1212428359.7239.4.camel@cunning \
--to=ben.collins@canonical.com \
--cc=drzeus-mmc@drzeus.cx \
--cc=kernel-team@lists.ubuntu.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox