As reported by Stefan Tauner on IRC, the new programmer-centric logic
is broken by re-using occupied members of the flashes array when changing
to the next programmer. This fixes it

Signed-off-by: Michael Karcher <[email protected]>
---
 cli_classic.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/cli_classic.c b/cli_classic.c
index 543b644..10ed0f4 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -451,14 +451,17 @@ int main(int argc, char *argv[])
 
        for (j = 0; j < registered_programmer_count; j++) {
                startchip = 0;
-               for (i = 0; i < ARRAY_SIZE(flashes); i++) {
+               do {
                        startchip = probe_flash(&registered_programmers[j],
-                                               startchip, &flashes[i], 0);
-                       if (startchip == -1)
-                               break;
-                       chipcount++;
-                       startchip++;
+                                               startchip, 
+                                               &flashes[chipcount], 0);
+                       if (startchip != -1)
+                       {
+                               chipcount++;
+                               startchip++;
+                       }
                }
+               while( startchip != -1 && chipcount < ARRAY_SIZE(flashes) );
        }
 
        if (chipcount > 1) {
-- 
1.7.7.3


_______________________________________________
flashrom mailing list
[email protected]
http://www.flashrom.org/mailman/listinfo/flashrom

Reply via email to