Felix Singer submitted this change.
bitbang_spi.c: Fix unchecked heap allocation
Change-Id: Ib64b1fe67fa1874875453ab9e1700e468c579e7c
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Reviewed-on: https://review.coreboot.org/c/flashrom/+/68775
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Felix Singer <felixsinger@posteo.net>
---
M bitbang_spi.c
1 file changed, 17 insertions(+), 0 deletions(-)
diff --git a/bitbang_spi.c b/bitbang_spi.c
index 10c1087..5e4b566 100644
--- a/bitbang_spi.c
+++ b/bitbang_spi.c
@@ -165,6 +165,9 @@
}
struct bitbang_spi_master_data *data = calloc(1, sizeof(*data));
+ if (!data)
+ return ERROR_FATAL;
+
data->master = master;
if (spi_data)
data->spi_data = spi_data;
To view, visit change 68775. To unsubscribe, or for help writing mail filters, visit settings.