DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Usman Tanveer <usman.tanveer@emumba.com>
Cc: dev <dev@dpdk.org>, Ciara Power <ciara.power@intel.com>,
	 Nithin Dabilpuram <ndabilpuram@marvell.com>,
	 Kiran Kumar Kokkilagadda <kirankumark@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Satha Rao <skoteshwar@marvell.com>
Subject: Re: [PATCH] net/cnxk: fix segmentation fault in telemetry
Date: Thu, 30 Jun 2022 11:34:41 +0200	[thread overview]
Message-ID: <CAJFAV8w0Sy6DZ28--92nBQt92ZVN4-iV=wE3wuoxv2EosR_zuQ@mail.gmail.com> (raw)
In-Reply-To: <20220630092422.114332-1-usman.tanveer@emumba.com>

On Thu, Jun 30, 2022 at 11:24 AM Usman Tanveer <usman.tanveer@emumba.com> wrote:
>
> It gives segmentation fault when no parameter is passed for
> command '/cnxk/ipsec/info' in usertools/telemetry app as NULL
> is being passed as parameter to strtoul(). Now this function
> returns -1 before strtoul() if no parameter is passed.
>
> Signed-off-by: Usman Tanveer <usman.tanveer@emumba.com>
> ---
>  drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
> index dfad5af8fe..088798d70a 100644
> --- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
> +++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
> @@ -229,6 +229,9 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
>         uint32_t i;
>         int ret;
>
> +       if (params == NULL || strlen(params) == 0 || !isdigit(*params))
> +               return -1;
> +
>         port_id = strtoul(params, &end_p, 0);
>         if (errno != 0)
>                 return -EINVAL;

Duplicate of already merged: https://git.dpdk.org/dpdk/commit/?id=a31c9f970dfd


-- 
David Marchand


      reply	other threads:[~2022-06-30  9:34 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30  9:24 Usman Tanveer
2022-06-30  9:34 ` David Marchand [this message]

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='CAJFAV8w0Sy6DZ28--92nBQt92ZVN4-iV=wE3wuoxv2EosR_zuQ@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=ciara.power@intel.com \
    --cc=dev@dpdk.org \
    --cc=kirankumark@marvell.com \
    --cc=ndabilpuram@marvell.com \
    --cc=skori@marvell.com \
    --cc=skoteshwar@marvell.com \
    --cc=usman.tanveer@emumba.com \
    /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).