summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJianfeng Tan <jianfeng.tan@intel.com>2016-06-29 09:05:35 +0000
committerYuanhan Liu <yuanhan.liu@linux.intel.com>2016-07-05 13:30:24 +0200
commit14f06474b8b961f99d85028153155515dd38559c (patch)
tree0796f199cab195d3518163d3ad966c588a933b59 /drivers
parent80ceb374e23a993b43628ab8437fce8d720f52fb (diff)
downloaddpdk-14f06474b8b961f99d85028153155515dd38559c.zip
dpdk-14f06474b8b961f99d85028153155515dd38559c.tar.gz
dpdk-14f06474b8b961f99d85028153155515dd38559c.tar.xz
net/virtio-user: fix resource leaks
The return value by rte_kvargs_parse is not free(d), which leads to memory leak. Coverity issue: 127482 Fixes: ce2eabdd43ec ("net/virtio-user: add virtual device") Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com> Acked-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/virtio/virtio_user_ethdev.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/virtio/virtio_user_ethdev.c b/drivers/net/virtio/virtio_user_ethdev.c
index dc6f0dd..782d7d3 100644
--- a/drivers/net/virtio/virtio_user_ethdev.c
+++ b/drivers/net/virtio/virtio_user_ethdev.c
@@ -320,7 +320,7 @@ virtio_user_eth_dev_alloc(const char *name)
static int
virtio_user_pmd_devinit(const char *name, const char *params)
{
- struct rte_kvargs *kvlist;
+ struct rte_kvargs *kvlist = NULL;
struct rte_eth_dev *eth_dev;
struct virtio_hw *hw;
uint64_t queues = VIRTIO_USER_DEF_Q_NUM;
@@ -422,6 +422,8 @@ virtio_user_pmd_devinit(const char *name, const char *params)
ret = 0;
end:
+ if (kvlist)
+ rte_kvargs_free(kvlist);
if (path)
free(path);
if (mac_addr)