From: Brian Foster <brian.foster@maxim-ic.com>
To: <linux-mtd@lists.infradead.org>
Cc: Mike Frysinger <vapier@gentoo.org>
Subject: [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions
Date: Mon, 25 Jul 2011 11:48:51 +0200 [thread overview]
Message-ID: <201107251148.51262.brian.foster@maxim-ic.com> (raw)
Hello!
Massive apologies if this is not the correct list or
not the correct way of reporting MTD-utils bugs.
My searches failed to find anything .... ;-\
MTD-utils 1.4.5, when `mtdinfo -a' tries to print the
eraseblock regions of NOR-Flash, it open(2)s the nil
pointer (NULL). The problem seems to be in mtdinfo.c's
print_region_info(), which assumes there is always a MTD
/dev node name (args.node). However, in the case of `-a',
args.node is always NULL. Oops!
------------------------------------
# dmesg #output abbreviated ....
...
[ 15.890000] physmap platform flash device: 02000000 at 40000000
[ 15.910000] physmap-flash.0: Found 1 x16 devices at 0x0 in 16-bit bank. Manufacturer ID 0x000001 Chip ID 0x002201
[ 15.930000] Amd/Fujitsu Extended Query Table at 0x0040
[ 15.930000] Amd/Fujitsu Extended Query version 1.3.
[ 15.940000] number of CFI chips: 1
...
# mtdinfo /dev/mtd0
mtd0
Name: physmap-flash.0
Type: nor
Eraseblock size: 131072 bytes, 128.0 KiB
Amount of eraseblocks: 256 (33554432 bytes, 32.0 MiB)
Minimum input/output unit size: 1 byte
Sub-page size: 1 byte
Additional erase regions: 0
Character device major/minor: 90:0
Bad blocks are allowed: false
Device is writable: true
Eraseblock region 0: offset: 0xc10e2e21 size: 0xc10e2fe8 numblocks: 0x1
# mtdinfo -a #output abbreviated ....
...
mtd0
...
Bad blocks are allowed: false
Device is writable: true
mtdinfo: error!: couldn't open MTD dev: (null)
error 14 (Bad address)
...
------------------------------------
I think the problem was introduced by commit 266061ebd5
(CC-ed to the author of that commit, Mike Frysinger).
It appears to still exist in the the current wavefront.
I do not have a proposed fix, Sorry!
cheers,
-blf-
--
Brian FOSTER
Principal MTS, Software
Maxim Integrated Products (Microcontroller BU), formerly Innova Card
Web : http://www.maxim-ic.com/
next reply other threads:[~2011-07-25 9:49 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-25 9:48 Brian Foster [this message]
2011-07-25 17:10 ` [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions Brian Norris
2011-07-26 7:21 ` Brian Foster
2011-08-04 17:46 ` Brian Norris
2011-08-04 22:41 ` Mike Frysinger
2011-08-06 0:09 ` Brian Norris
2011-08-06 1:18 ` Mike Frysinger
2011-08-08 8:16 ` Brian Foster
2011-08-08 23:19 ` Brian Norris
2011-08-09 7:27 ` Brian Foster
2011-08-09 17:34 ` Mike Frysinger
2011-08-09 19:59 ` Brian Norris
2011-08-15 4:11 ` Artem Bityutskiy
2011-08-15 23:13 ` Brian Norris
2011-08-16 14:17 ` Artem Bityutskiy
2011-08-16 7:31 ` Brian Foster
2011-08-16 17:47 ` Brian Norris
2011-08-08 8:10 ` Brian Foster
2011-08-08 8:40 ` Brian Foster
2011-08-05 7:24 ` Brian Foster
2011-08-06 0:06 ` Brian Norris
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=201107251148.51262.brian.foster@maxim-ic.com \
--to=brian.foster@maxim-ic.com \
--cc=linux-mtd@lists.infradead.org \
--cc=vapier@gentoo.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