All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions
@ 2011-07-25  9:48 Brian Foster
  2011-07-25 17:10 ` Brian Norris
  0 siblings, 1 reply; 21+ messages in thread
From: Brian Foster @ 2011-07-25  9:48 UTC (permalink / raw)
  To: linux-mtd; +Cc: Mike Frysinger

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/

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

end of thread, other threads:[~2011-08-16 17:47 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-25  9:48 [BUG] mtdinfo -a: Tries to open NULL pointer for NOR with Eraseblock Regions Brian Foster
2011-07-25 17:10 ` 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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.