net/nfp: fix possible memory leak
Memory allocated was not being released in any exit path. Coverity issue: 195030 Fixes: 48e2255f1b63 ("net/nfp: add NSP support for HW link configuration") Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
This commit is contained in:
parent
fee720e929
commit
7c90eef52f
@ -566,6 +566,7 @@ nfp_nsp_eth_config(nspu_desc_t *desc, int port, int up)
|
||||
NSP_ETH_TABLE_SIZE, 0);
|
||||
if (ret) {
|
||||
rte_spinlock_unlock(&desc->nsp_lock);
|
||||
free(entries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -586,6 +587,7 @@ nfp_nsp_eth_config(nspu_desc_t *desc, int port, int up)
|
||||
|
||||
if (i == NSP_ETH_MAX_COUNT) {
|
||||
rte_spinlock_unlock(&desc->nsp_lock);
|
||||
free(entries);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@ -610,6 +612,7 @@ nfp_nsp_eth_config(nspu_desc_t *desc, int port, int up)
|
||||
"Hw ethernet port %d configure failed\n", port);
|
||||
}
|
||||
rte_spinlock_unlock(&desc->nsp_lock);
|
||||
free(entries);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user