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>
This commit is contained in:
parent
06b4903e3e
commit
e6fc371e2e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue