[dpdk-dev] net/nfp: release memory before exit
Checks
Commit Message
Memory allocated was not being released in any exit path.
Fixes: 48e2255f1b63 ("net/nfp: add NSP support for HW link configuration")
Coverity: 195030
Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
---
drivers/net/nfp/nfp_nspu.c | 3 +++
1 file changed, 3 insertions(+)
Comments
On 11/8/2017 6:42 AM, Alejandro Lucero wrote:
> Memory allocated was not being released in any exit path.
>
> Fixes: 48e2255f1b63 ("net/nfp: add NSP support for HW link configuration")
> Coverity: 195030
>
> Signed-off-by: Alejandro Lucero <alejandro.lucero@netronome.com>
Applied to dpdk/master, thanks.
@@ -566,6 +566,7 @@
NSP_ETH_TABLE_SIZE, 0);
if (ret) {
rte_spinlock_unlock(&desc->nsp_lock);
+ free(entries);
return ret;
}
@@ -586,6 +587,7 @@
if (i == NSP_ETH_MAX_COUNT) {
rte_spinlock_unlock(&desc->nsp_lock);
+ free(entries);
return -EINVAL;
}
@@ -610,6 +612,7 @@
"Hw ethernet port %d configure failed\n", port);
}
rte_spinlock_unlock(&desc->nsp_lock);
+ free(entries);
return ret;
}