From: Nithin Dabilpuram <ndabilpuram@marvell.com>
To: <pbhagavatula@marvell.com>
Cc: <jerinj@marvell.com>, Kiran Kumar K <kirankumark@marvell.com>,
<dev@dpdk.org>
Subject: Re: [dpdk-dev] [PATCH] examples/l3fwd-graph: fix unchecked function return values
Date: Thu, 14 May 2020 16:09:31 +0530 [thread overview]
Message-ID: <20200514103931.GA29118@outlook.office365.com> (raw)
In-Reply-To: <20200513202218.6045-1-pbhagavatula@marvell.com>
On Thu, May 14, 2020 at 01:52:17AM +0530, pbhagavatula@marvell.com wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
>
> Fix unchecked return values reported by coverity.
>
> Coverity issue: 350601
> Fixes: ef853f1fd979 ("examples/l3fwd-graph: add ethdev configuration changes")
>
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
Acked-by: Nithin Dabilpuram <ndabilpuram@marvell.com>
> ---
> examples/l3fwd-graph/main.c | 10 +++++++++-
> 1 file changed, 9 insertions(+), 1 deletion(-)
>
> diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c
> index 40108a0d3..c70270c4d 100644
> --- a/examples/l3fwd-graph/main.c
> +++ b/examples/l3fwd-graph/main.c
> @@ -598,6 +598,7 @@ check_all_ports_link_status(uint32_t port_mask)
> uint8_t count, all_ports_up, print_flag = 0;
> struct rte_eth_link link;
> uint16_t portid;
> + int ret;
>
> printf("\nChecking link status");
> fflush(stdout);
> @@ -612,7 +613,14 @@ check_all_ports_link_status(uint32_t port_mask)
> if ((port_mask & (1 << portid)) == 0)
> continue;
> memset(&link, 0, sizeof(link));
> - rte_eth_link_get_nowait(portid, &link);
> + ret = rte_eth_link_get_nowait(portid, &link);
> + if (ret < 0) {
> + all_ports_up = 0;
> + if (print_flag == 1)
> + printf("Port %u link get failed: %s\n",
> + portid, rte_strerror(-ret));
> + continue;
> + }
> /* Print link status if flag set */
> if (print_flag == 1) {
> if (link.link_status)
> --
> 2.17.1
>
next prev parent reply other threads:[~2020-05-14 10:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-13 20:22 pbhagavatula
2020-05-14 10:39 ` Nithin Dabilpuram [this message]
2020-05-19 17:14 ` 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=20200514103931.GA29118@outlook.office365.com \
--to=ndabilpuram@marvell.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
--cc=kirankumark@marvell.com \
--cc=pbhagavatula@marvell.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).