public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Alice Hennessy <ahennessy@mvista.com>
To: linux-mtd@lists.infradead.org
Subject: gen_probe.c issue
Date: Wed, 28 Jan 2004 16:18:21 -0800	[thread overview]
Message-ID: <4018514D.6E4DB38A@mvista.com> (raw)

Hi,

The following patch fixes a problem seen when the map->size is less than
the actual chip size.
Without the fix,  max_chips gets set to 0.

Alice

Index: drivers/mtd/chips/gen_probe.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/chips/gen_probe.c,v
retrieving revision 1.14
diff -u -r1.14 gen_probe.c
--- drivers/mtd/chips/gen_probe.c       8 Nov 2003 00:51:21 -0000
1.14
+++ drivers/mtd/chips/gen_probe.c       28 Jan 2004 23:58:38 -0000
@@ -108,6 +108,9 @@
         * Align bitmap storage size to full byte.
         */
        max_chips = map->size >> cfi.chipshift;
+        /* correct for case where map->size is less than chip size */
+        if (!max_chips)
+                max_chips = 1;
        chip_map = kmalloc((max_chips / 8) + ((max_chips % 8) ? 1 : 0),
GFP_KERNEL);
        if (!chip_map) {
                printk(KERN_WARNING "%s: kmalloc failed for CFI chip
map\n", map->name);

             reply	other threads:[~2004-01-29  0:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-29  0:18 Alice Hennessy [this message]
2004-01-30 22:55 ` gen_probe.c issue andrzej_mialkowski
2004-02-03 18:35   ` gen probe.c issue Alice Hennessy
2004-02-03 22:30     ` David Woodhouse
2004-02-03 22:41       ` Alice Hennessy

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=4018514D.6E4DB38A@mvista.com \
    --to=ahennessy@mvista.com \
    --cc=linux-mtd@lists.infradead.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