summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo de Lara <pablo.de.lara.guarch@intel.com>2016-07-18 14:21:04 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2016-07-22 11:53:32 +0200
commit5a4e71f1f461a93b34fae5249f8131f1039bb3bc (patch)
tree35557bb30231620377e20911c6339dc31f2a0647
parente8df94b86f9d224d45530c0c7a7ff013742450e3 (diff)
downloaddpdk-5a4e71f1f461a93b34fae5249f8131f1039bb3bc.zip
dpdk-5a4e71f1f461a93b34fae5249f8131f1039bb3bc.tar.gz
dpdk-5a4e71f1f461a93b34fae5249f8131f1039bb3bc.tar.xz
cryptodev: fix memory leak in parameter parsing
When parsing the parameters for virtual device initialization, rte_kvargs structure was being freed only if there was an error, not when parsing was successful. Coverity issue: 124568 Fixes: f3e764fa2fb7 ("cryptodev: uninline parameter parsing") Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com> Acked-by: Reshma Pattan <reshma.pattan@intel.com>
-rw-r--r--lib/librte_cryptodev/rte_cryptodev.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c
index 20e5beb..fc4123b 100644
--- a/lib/librte_cryptodev/rte_cryptodev.c
+++ b/lib/librte_cryptodev/rte_cryptodev.c
@@ -148,8 +148,8 @@ int
rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params,
const char *input_args)
{
- struct rte_kvargs *kvlist;
- int ret;
+ struct rte_kvargs *kvlist = NULL;
+ int ret = 0;
if (params == NULL)
return -EINVAL;
@@ -187,8 +187,6 @@ rte_cryptodev_parse_vdev_init_params(struct rte_crypto_vdev_init_params *params,
}
}
- return 0;
-
free_kvlist:
rte_kvargs_free(kvlist);
return ret;