Edward O'Callaghan has uploaded this change for review.

View Change

it87spi.c: Simplify param free like cros

The CrOS fork of Flashrom has a little bit of a simplier path
for free'ing the param. Replicate it here.

Change-Id: Ia17dfcaf758f729ae25b35d807bfbe5dc3dc5ff6
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
---
M it87spi.c
1 file changed, 1 insertion(+), 2 deletions(-)

git pull ssh://review.coreboot.org:29418/flashrom refs/changes/23/49823/1
diff --git a/it87spi.c b/it87spi.c
index 868b479..04c9aef 100644
--- a/it87spi.c
+++ b/it87spi.c
@@ -324,13 +324,12 @@
char *dualbiosindex_suffix;
errno = 0;
long chip_index = strtol(param, &dualbiosindex_suffix, 0);
+ free(param);
if (errno != 0 || *dualbiosindex_suffix != '\0' || chip_index < 0 || chip_index > 1) {
msg_perr("DualBIOS: Invalid chip index requested - choose 0 or 1.\n");
- free(param);
exit_conf_mode_ite(port);
return 1;
}
- free(param);
if (chip_index != (tmp & 1)) {
msg_pdbg("DualBIOS: Previous chip index: %d\n", tmp & 1);
sio_write(port, 0xEF, (tmp & 0xFE) | chip_index);

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: Ia17dfcaf758f729ae25b35d807bfbe5dc3dc5ff6
Gerrit-Change-Number: 49823
Gerrit-PatchSet: 1
Gerrit-Owner: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-MessageType: newchange