Nico Huber submitted this change.

View Change

Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
mec1308.c: Ensure programmer param variable is always initialised

Programmer param variable is now declared inline with the code and
is const, so that it cannot be used uninitialised.

BUG=b:185191942
TEST=builds and ninja test from 51487

Change-Id: I2d2b3039da2ef185cb31509b3901d56b428688b7
Signed-off-by: Anastasia Klimchuk <aklm@chromium.org>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/52719
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
---
M mec1308.c
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mec1308.c b/mec1308.c
index 0ec9be9..1530d9b 100644
--- a/mec1308.c
+++ b/mec1308.c
@@ -409,9 +409,7 @@
static int check_params(void)
{
int ret = 0;
- char *p = NULL;
-
- p = extract_programmer_param("type");
+ char *const p = extract_programmer_param("type");
if (p && strcmp(p, "ec")) {
msg_pdbg("mec1308 only supports \"ec\" type devices\n");
ret = 1;

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

Gerrit-Project: flashrom
Gerrit-Branch: master
Gerrit-Change-Id: I2d2b3039da2ef185cb31509b3901d56b428688b7
Gerrit-Change-Number: 52719
Gerrit-PatchSet: 2
Gerrit-Owner: Anastasia Klimchuk <aklm@chromium.org>
Gerrit-Reviewer: Angel Pons <th3fanbus@gmail.com>
Gerrit-Reviewer: Edward O'Callaghan <quasisec@chromium.org>
Gerrit-Reviewer: Nico Huber <nico.h@gmx.de>
Gerrit-Reviewer: build bot (Jenkins) <no-reply@coreboot.org>
Gerrit-CC: Victor Ding <victording@google.com>
Gerrit-MessageType: merged