1
0
mirror of https://review.coreboot.org/flashrom.git synced 2025-04-30 16:33:41 +02:00

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>
This commit is contained in:
Anastasia Klimchuk 2021-04-28 12:05:38 +10:00 committed by Nico Huber
parent 04fff28b46
commit 02350a6fcc

View File

@ -409,9 +409,7 @@ static struct spi_master spi_master_mec1308 = {
static int check_params(void) static int check_params(void)
{ {
int ret = 0; int ret = 0;
char *p = NULL; char *const p = extract_programmer_param("type");
p = extract_programmer_param("type");
if (p && strcmp(p, "ec")) { if (p && strcmp(p, "ec")) {
msg_pdbg("mec1308 only supports \"ec\" type devices\n"); msg_pdbg("mec1308 only supports \"ec\" type devices\n");
ret = 1; ret = 1;