From: Stephen Hemminger Date: Thu, 25 Jun 2020 20:32:07 +0000 (-0700) Subject: rib: check for negative maximum of nodes X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;ds=sidebyside;h=58607c2e27b391b2a382a8316cb490ad78118153;p=dpdk.git rib: check for negative maximum of nodes Max_nodes in config is signed, but a negative value makes no sense. Get rid of extra BSD style parens. Signed-off-by: Stephen Hemminger Acked-by: Vladimir Medvedkin --- diff --git a/lib/librte_rib/rte_rib.c b/lib/librte_rib/rte_rib.c index e40cf715c0..2a370d7f84 100644 --- a/lib/librte_rib/rte_rib.c +++ b/lib/librte_rib/rte_rib.c @@ -401,8 +401,7 @@ rte_rib_create(const char *name, int socket_id, const struct rte_rib_conf *conf) struct rte_mempool *node_pool; /* Check user arguments. */ - if ((name == NULL) || (conf == NULL) || - (conf->max_nodes == 0)) { + if (name == NULL || conf == NULL || conf->max_nodes <= 0) { rte_errno = EINVAL; return NULL; } diff --git a/lib/librte_rib/rte_rib6.c b/lib/librte_rib/rte_rib6.c index 02563b9516..f6c55ee454 100644 --- a/lib/librte_rib/rte_rib6.c +++ b/lib/librte_rib/rte_rib6.c @@ -460,8 +460,7 @@ rte_rib6_create(const char *name, int socket_id, struct rte_mempool *node_pool; /* Check user arguments. */ - if ((name == NULL) || (conf == NULL) || - (conf->max_nodes == 0)) { + if (name == NULL || conf == NULL || conf->max_nodes <= 0) { rte_errno = EINVAL; return NULL; }