summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlejandro Lucero <alejandro.lucero@netronome.com>2017-11-08 14:42:23 +0000
committerFerruh Yigit <ferruh.yigit@intel.com>2017-11-10 09:31:24 +0000
commit7c90eef52f5bda290861827a6e732c1a0617162c (patch)
tree7654ac8b3e59c5b891cfcbf3d6866bd0b84146ac
parentfee720e9292529c08f6a80ed05bd47d559812916 (diff)
downloaddpdk-7c90eef52f5bda290861827a6e732c1a0617162c.zip
dpdk-7c90eef52f5bda290861827a6e732c1a0617162c.tar.gz
dpdk-7c90eef52f5bda290861827a6e732c1a0617162c.tar.xz
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>
-rw-r--r--drivers/net/nfp/nfp_nspu.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/nfp/nfp_nspu.c b/drivers/net/nfp/nfp_nspu.c
index 0b415fc..f908983 100644
--- a/drivers/net/nfp/nfp_nspu.c
+++ b/drivers/net/nfp/nfp_nspu.c
@@ -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;
}