Skip to content

Commit 5aeb95b

Browse files
slawblauciaklgirdwood
authored andcommitted
sanity check allocated memory
Issue detected by Klocwork Signed-off-by: Slawomir Blauciak <slawomir.blauciak@linux.intel.com>
1 parent 6f45b61 commit 5aeb95b

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/adsp_config.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1773,6 +1773,9 @@ static int parse_pin(const toml_table_t *mod_entry, struct parse_ctx *ctx,
17731773
ext_mod_config->pin_desc = calloc(sizeof(const struct fw_pin_description),
17741774
toml_array_nelem(arr) / 6);
17751775

1776+
if(!ext_mod_config->pin_desc)
1777+
return err_malloc("pin");
1778+
17761779
j = 0;
17771780
for (i = 0; ; i += 6, j++) {
17781781
raw = toml_raw_at(arr, i);

0 commit comments

Comments
 (0)