diff options
author | Edward O'Callaghan <quasisec@google.com> | 2022-10-25 10:36:28 +1100 |
---|---|---|
committer | Felix Singer <felixsinger@posteo.net> | 2022-11-09 14:39:59 +0000 |
commit | d127668cae0eabab854862683128fb7245282547 (patch) | |
tree | a5903a63ced015d00c4d74302a26a96612dcb1d0 | |
parent | c726a693d68f4169846811fdc332428b44cf7ab3 (diff) | |
download | flashrom-d127668cae0eabab854862683128fb7245282547.tar.gz flashrom-d127668cae0eabab854862683128fb7245282547.tar.bz2 flashrom-d127668cae0eabab854862683128fb7245282547.zip |
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>
-rw-r--r-- | bitbang_spi.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/bitbang_spi.c b/bitbang_spi.c index 10c10872..5e4b566b 100644 --- a/bitbang_spi.c +++ b/bitbang_spi.c @@ -165,6 +165,9 @@ int register_spi_bitbang_master(const struct bitbang_spi_master *master, void *s } 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; |