diff options
author | Brian Norris <computersforpeace@gmail.com> | 2011-08-09 14:36:42 -0700 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@intel.com> | 2011-08-16 17:12:17 +0300 |
commit | 8faa32ae07b0fce0636f6e57d9dd4a93db0ebc13 (patch) | |
tree | 688669caa72d30d330741de0265e76657344936c /tests/fs-tests | |
parent | f1fe865bc582649c85f4ece1baf2905f877d3964 (diff) |
mtdinfo: don't open NULL pointer when getting region_info with `-a'
This "fixes" a regression found in:
commit 266061ebd5d72391f0a0e831b018e8fc7fea68a1
mtdinfo: add regioninfo/eraseblock map display
On certain flash (NOR flash that have eraseblock region info),
`mtdinfo -a' tries to open the MTD node file, for use with the ioctl
MEMGETREGIONINFO; however, we didn't supply a device node path to
`mtdinfo -a', so it's using NULL, resulting in errors like:
mtdinfo: error!: couldn't open MTD dev: (null)
error 14 (Bad address)
For now, we can just skip dumping region_info with the `-a' flag. If we
find a better way to do this (e.g., export via sysfs, find device nodes
via automatic routines, etc.), then we can kill the workaround and this
FIXME should be removed.
The regression was first reported at:
http://lists.infradead.org/pipermail/linux-mtd/2011-July/037232.html
The result of recent changes is that we cannot get region_info for devices
via the `--all' option. We add a note in the help message warning that
mtdinfo may find more info when given a device patch, e.g., /dev/mtdX.
Reported-by: Brian Foster <brian.foster@maxim-ic.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@intel.com>
Diffstat (limited to 'tests/fs-tests')
0 files changed, 0 insertions, 0 deletions