If the function actually returns a null value, a null pointer
dereference will occur.
Coverity issue: 195013
Fixes:
dd63df2bfff3 ("net/nfp: add NSP symbol resolution command")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
int ret = 0;
sym_buf = malloc(desc->buf_size);
int ret = 0;
sym_buf = malloc(desc->buf_size);
+ if (!sym_buf)
+ return -ENOMEM;
+
strncpy(sym_buf, symbl, strlen(symbl));
ret = nspu_command(desc, NSP_CMD_GET_SYMBOL, 1, 1, sym_buf,
NFP_SYM_DESC_LEN, strlen(symbl));
strncpy(sym_buf, symbl, strlen(symbl));
ret = nspu_command(desc, NSP_CMD_GET_SYMBOL, 1, 1, sym_buf,
NFP_SYM_DESC_LEN, strlen(symbl));