From: Adrian Chiris Date: Thu, 14 Jan 2016 17:13:08 +0000 (+0200) Subject: fixed possible issue where Flash IDs as ST when more than 1 flash bank is checked X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=a831df6dd7ac995a5fb5cbd693873ceca86cceed;p=~adrianc%2Fmstflint.git fixed possible issue where Flash IDs as ST when more than 1 flash bank is checked --- diff --git a/mflash/mflash.c b/mflash/mflash.c index 7afb80d..962686e 100644 --- a/mflash/mflash.c +++ b/mflash/mflash.c @@ -722,7 +722,9 @@ int cntx_get_flash_info(mflash* mfl, flash_info_t *f_info, int *log2size, u_int8 printf("-E- SPI flash #%d (vendor: %#x, memory type: %#x, es: %#x) is not supported.\n", get_bank_int(mfl), vendor, type, es); } // printf("-D- rc = %d, no_flash_res = %d, type_index = %d.\n", rc, no_flash_res, *type_index); - memcpy(f_info, &g_flash_info_arr[type_index], sizeof(flash_info_t)); + if (rc == MFE_OK && *no_flash == 0) { + memcpy(f_info, &g_flash_info_arr[type_index], sizeof(flash_info_t)); + } return rc; }