David Reguera Garcia has uploaded this change for review.

View Change

buspirate_spi: Stop execution when invalid params

Change-Id: Icce40fa841bb3289db4a4895785bb19dfb625e5f
Signed-off-by: David Reguera Garcia <dreg@rootkit.es>
---
M buspirate_spi.c
1 file changed, 12 insertions(+), 6 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/05/79405/1
diff --git a/buspirate_spi.c b/buspirate_spi.c
index 7436d80..e09cea5 100644
--- a/buspirate_spi.c
+++ b/buspirate_spi.c
@@ -375,8 +375,10 @@
hiz = true;
else if (strcasecmp("off", tmp) == 0)
; // ignore
- else
- msg_perr("Invalid hiz state, not using them.\n");
+ else {
+ msg_perr("Invalid hiz state. Use on/off.\n");
+ return 1;
+ }
}
free(tmp);

@@ -386,8 +388,10 @@
pullup = true;
else if (strcasecmp("off", tmp) == 0)
; // ignore
- else
- msg_perr("Invalid pullups state, not using them.\n");
+ else {
+ msg_perr("Invalid pullups state. Use on/off.\n");
+ return 1;
+ }
}
free(tmp);

@@ -397,8 +401,10 @@
psu = true;
else if (strcasecmp("off", tmp) == 0)
; // ignore
- else
- msg_perr("Invalid psus state, not enabling.\n");
+ else {
+ msg_perr("Invalid psus state. Use on/off.\n");
+ return 1;
+ }
}
free(tmp);


To view, visit change 79405. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: flashrom
Gerrit-Branch: main
Gerrit-Change-Id: Icce40fa841bb3289db4a4895785bb19dfb625e5f
Gerrit-Change-Number: 79405
Gerrit-PatchSet: 1
Gerrit-Owner: David Reguera Garcia <dreg@rootkit.es>
Gerrit-MessageType: newchange