First, the received pointer was not checked before. Then the pointer
from malloc was not the one used in the existing check.
Coverity issue: 195027
Fixes:
ad60bca34899 ("net/nfp: read PF port MAC addr using NSP")
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
{
int ret;
+ if (!table)
+ return -EINVAL;
+
RTE_LOG(INFO, PMD, "Reading hw ethernet table...\n");
+
/* port 0 allocates the eth table and read it using NSPU */
*table = malloc(NSP_ETH_TABLE_SIZE);
- if (!table)
+ if (!*table)
return -ENOMEM;
ret = nspu_command(desc, NSP_CMD_READ_ETH_TABLE, 1, 0, *table,