summaryrefslogtreecommitdiff
path: root/lib/librte_distributor
diff options
context:
space:
mode:
authorDavid Hunt <david.hunt@intel.com>2017-04-04 03:42:41 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2017-04-04 14:58:49 +0200
commit7c37da5a9ad9a9d933643375e23f013a4c43fe77 (patch)
tree97d4dcc3d1a25222ed089214a2e0d307ca351ef3 /lib/librte_distributor
parent201d52bc0df70fd5dde9a79b5b6cd70a21f6fd34 (diff)
downloaddpdk-next-eventdev-7c37da5a9ad9a9d933643375e23f013a4c43fe77.zip
dpdk-next-eventdev-7c37da5a9ad9a9d933643375e23f013a4c43fe77.tar.gz
dpdk-next-eventdev-7c37da5a9ad9a9d933643375e23f013a4c43fe77.tar.xz
distributor: fix creation error checks
Coverity issue 143258: not freeing distributor instance Coverity issue 143254: not checking return code from malloc Fixes: 775003ad2f96 ("distributor: add new burst-capable library") Signed-off-by: David Hunt <david.hunt@intel.com>
Diffstat (limited to 'lib/librte_distributor')
-rw-r--r--lib/librte_distributor/rte_distributor.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/librte_distributor/rte_distributor.c b/lib/librte_distributor/rte_distributor.c
index 06df13d..4725904 100644
--- a/lib/librte_distributor/rte_distributor.c
+++ b/lib/librte_distributor/rte_distributor.c
@@ -621,9 +621,14 @@ rte_distributor_create_v1705(const char *name,
if (alg_type == RTE_DIST_ALG_SINGLE) {
d = malloc(sizeof(struct rte_distributor));
+ if (d == NULL) {
+ rte_errno = ENOMEM;
+ return NULL;
+ }
d->d_v20 = rte_distributor_create_v20(name,
socket_id, num_workers);
if (d->d_v20 == NULL) {
+ free(d);
/* rte_errno will have been set */
return NULL;
}