summaryrefslogtreecommitdiff
path: root/cli_classic.c
diff options
context:
space:
mode:
authormkarcher <mkarcher@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-12-22 23:27:03 +0000
committermkarcher <mkarcher@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1>2011-12-22 23:27:03 +0000
commit7a7322bbf6c5edb9603218e692c1453cd8ce88d3 (patch)
treeea9c5b838bc0cc30b373d6450e1c705f18bab638 /cli_classic.c
parente9252c3ab20287c2c08275a56c67c8abae1cff74 (diff)
downloadflashrom-7a7322bbf6c5edb9603218e692c1453cd8ce88d3.tar.gz
Fix programmer-centric probe (patch v2)
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. patch v2: prevent probing one chip per programmer even if the array is full. Using a do-while loop was a bad idea. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1479 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'cli_classic.c')
-rw-r--r--cli_classic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cli_classic.c b/cli_classic.c
index 543b644..a931de8 100644
--- a/cli_classic.c
+++ b/cli_classic.c
@@ -451,9 +451,10 @@ int main(int argc, char *argv[])
for (j = 0; j < registered_programmer_count; j++) {
startchip = 0;
- for (i = 0; i < ARRAY_SIZE(flashes); i++) {
+ while (chipcount < ARRAY_SIZE(flashes)) {
startchip = probe_flash(&registered_programmers[j],
- startchip, &flashes[i], 0);
+ startchip,
+ &flashes[chipcount], 0);
if (startchip == -1)
break;
chipcount++;