DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Medvedkin, Vladimir" <vladimir.medvedkin@intel.com>
To: Stephen Hemminger <stephen@networkplumber.org>
Cc: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 2/3] rib: check for invalid max_nodes
Date: Fri, 26 Jun 2020 15:03:43 +0100	[thread overview]
Message-ID: <957cdb61-8bdd-f100-b575-cd9cc126eddd@intel.com> (raw)
In-Reply-To: <20200625203208.19315-3-stephen@networkplumber.org>


On 25/06/2020 21:32, Stephen Hemminger wrote:
> 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 <stephen@networkplumber.org>
> ---
>   lib/librte_rib/rte_rib.c  | 3 +--
>   lib/librte_rib/rte_rib6.c | 3 +--
>   2 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/lib/librte_rib/rte_rib.c b/lib/librte_rib/rte_rib.c
> index e40cf715c099..2a370d7f8439 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 02563b951620..f6c55ee454be 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;
>   	}

Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>


-- 
Regards,
Vladimir


  reply	other threads:[~2020-06-26 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-25 20:32 [dpdk-dev] [PATCH 0/3] rib: minor fixes Stephen Hemminger
2020-06-25 20:32 ` [dpdk-dev] [PATCH 1/3] rib: constify arguments Stephen Hemminger
2020-06-26 14:03   ` Medvedkin, Vladimir
2020-06-25 20:32 ` [dpdk-dev] [PATCH 2/3] rib: check for invalid max_nodes Stephen Hemminger
2020-06-26 14:03   ` Medvedkin, Vladimir [this message]
2020-06-25 20:32 ` [dpdk-dev] [PATCH 3/3] rib: add C++ include guard Stephen Hemminger
2020-06-26 14:04   ` Medvedkin, Vladimir
2020-07-07 21:25 ` [dpdk-dev] [PATCH 0/3] rib: minor fixes Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=957cdb61-8bdd-f100-b575-cd9cc126eddd@intel.com \
    --to=vladimir.medvedkin@intel.com \
    --cc=dev@dpdk.org \
    --cc=stephen@networkplumber.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).