diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2010-04-16 01:17:01 +0800 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-05-16 13:39:47 +0200 |
commit | c7b269ace1bbe07d5db7a562bb9242f4be32be67 (patch) | |
tree | ccc4405381e1f4964d72b0102757ea0cc8f588a7 /tools/release | |
parent | b8c54b362b395e50baf749366f6ec9e29fcba27e (diff) | |
download | openocd+libswd-c7b269ace1bbe07d5db7a562bb9242f4be32be67.tar.gz openocd+libswd-c7b269ace1bbe07d5db7a562bb9242f4be32be67.tar.bz2 openocd+libswd-c7b269ace1bbe07d5db7a562bb9242f4be32be67.tar.xz openocd+libswd-c7b269ace1bbe07d5db7a562bb9242f4be32be67.zip |
NOR/CFI: check "flash bank" command arguments
Arguments chip_width and bus_width of command "flash bank" are
not fully checked.
While bus_width is later on redundantly checked in several other
parts (e.g. in cfi_command_val()) and generates run-time error,
chip_width is never checked, nor related to actual bus_width
value.
Added check to avoid:
- (chip_width == 0), that would mean no memory chip at all,
avoiding also division by zero e.g. in cfi_get_u8();
- (bus_width == 0), that would mean no bus at all;
- unsupported cases of chip_width or bus_width value not power
of 2;
- unsupported case of chip width wider than bus.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Diffstat (limited to 'tools/release')
0 files changed, 0 insertions, 0 deletions