mirror of
https://review.coreboot.org/flashrom.git
synced 2025-04-27 15:12:36 +02:00
spi25_statusreg: Return defined value on failed RDSR
The interface of spi_read_status_register() is broken and can't return errors. Let's not return random stack data at least. Change-Id: I714b20001a5443bba665c2e0061ca14069777581 Signed-off-by: Nico Huber <nico.h@gmx.de> Reviewed-on: https://review.coreboot.org/22017 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: David Hendricks <david.hendricks@gmail.com>
This commit is contained in:
parent
8b2152d54a
commit
1f081530b6
@ -117,8 +117,11 @@ uint8_t spi_read_status_register(struct flashctx *flash)
|
||||
|
||||
/* Read Status Register */
|
||||
ret = spi_send_command(flash, sizeof(cmd), sizeof(readarr), cmd, readarr);
|
||||
if (ret)
|
||||
if (ret) {
|
||||
msg_cerr("RDSR failed!\n");
|
||||
/* FIXME: We should propagate the error. */
|
||||
return 0;
|
||||
}
|
||||
|
||||
return readarr[0];
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user