diff options
author | Antonio Borneo <borneo.antonio@gmail.com> | 2010-11-18 15:01:03 +0800 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2010-11-23 08:37:28 +0100 |
commit | e6fc371e2e86a00c7e84004b94c4b8374634953d (patch) | |
tree | 757cfadc0fe1508669c63a04edbc2ce1e89f2588 | |
parent | 06b4903e3e932a5d21d20adba551c36c296496ce (diff) | |
download | openocd+libswd-e6fc371e2e86a00c7e84004b94c4b8374634953d.tar.gz openocd+libswd-e6fc371e2e86a00c7e84004b94c4b8374634953d.tar.bz2 openocd+libswd-e6fc371e2e86a00c7e84004b94c4b8374634953d.tar.xz openocd+libswd-e6fc371e2e86a00c7e84004b94c4b8374634953d.zip |
NOR/SPEARSMI: fix segfault
If flash chip is not listed in the table, or if no flash is
connected, pointer must be properly initialized.
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
-rw-r--r-- | src/flash/nor/spearsmi.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/flash/nor/spearsmi.c b/src/flash/nor/spearsmi.c index c3bc2ec5..5e6a2c47 100644 --- a/src/flash/nor/spearsmi.c +++ b/src/flash/nor/spearsmi.c @@ -647,6 +647,7 @@ static int spearsmi_probe(struct flash_bank *bank) if (retval != ERROR_OK) return retval; + spearsmi_info->dev = NULL; for (struct flash_device *p = flash_devices; p->name ; p++) if (p->device_id == id) { spearsmi_info->dev = p; |