From: Declan Doherty <declan.doherty@intel.com>
To: ptazarex@ecsmtp.igk.intel.com
Cc: dev@dpdk.org, Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
Subject: Re: [dpdk-dev] [PATCH v1 1/1] examples/bond: fix unchecked return value
Date: Thu, 30 Jun 2016 10:13:48 +0100 [thread overview]
Message-ID: <4ea6fad1-ff5d-ff73-3200-7e92a7b92481@intel.com> (raw)
In-Reply-To: <1467192217-182940-1-git-send-email-piotrx.t.azarewicz@intel.com>
On 29/06/16 10:23, ptazarex@ecsmtp.igk.intel.com wrote:
> The example is calling rte_eal_wait_lcore without checking return value.
> Now it is fixed by checking the value and print proper message.
>
> Coverity issue: 37789
> Coverity issue: 37790
> Fixes: cc7e8ae84faa ("examples/bond: add example application for link bonding mode 6")
>
> Signed-off-by: Piotr Azarewicz <piotrx.t.azarewicz@intel.com>
> ---
> examples/bond/main.c | 24 ++++++++++++++++--------
> 1 file changed, 16 insertions(+), 8 deletions(-)
>
> diff --git a/examples/bond/main.c b/examples/bond/main.c
> index 53bd044..776fad0 100644
> --- a/examples/bond/main.c
> +++ b/examples/bond/main.c
> @@ -590,10 +590,14 @@ static void cmd_stop_parsed(__attribute__((unused)) void *parsed_result,
> return;
> }
> global_flag_stru_p->LcoreMainIsRunning = 0;
> - rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore);
> - cmdline_printf(cl,
> - "lcore_main stopped on core:%d\n",
> - global_flag_stru_p->LcoreMainCore);
> + if (rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore) < 0)
> + cmdline_printf(cl,
> + "error: lcore_main can not stop on core:%d\n",
> + global_flag_stru_p->LcoreMainCore);
> + else
> + cmdline_printf(cl,
> + "lcore_main stopped on core:%d\n",
> + global_flag_stru_p->LcoreMainCore);
> rte_spinlock_unlock(&global_flag_stru_p->lock);
> }
>
> @@ -628,10 +632,14 @@ static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
> return;
> }
> global_flag_stru_p->LcoreMainIsRunning = 0;
> - rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore);
> - cmdline_printf(cl,
> - "lcore_main stopped on core:%d\n",
> - global_flag_stru_p->LcoreMainCore);
> + if (rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore) < 0)
> + cmdline_printf(cl,
> + "error: lcore_main can not stop on core:%d\n",
> + global_flag_stru_p->LcoreMainCore);
> + else
> + cmdline_printf(cl,
> + "lcore_main stopped on core:%d\n",
> + global_flag_stru_p->LcoreMainCore);
> rte_spinlock_unlock(&global_flag_stru_p->lock);
> cmdline_quit(cl);
> }
>
Acked-by: Declan Doherty <declan.doherty@intel.com>
next parent reply other threads:[~2016-06-30 9:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1467192217-182940-1-git-send-email-piotrx.t.azarewicz@intel.com>
2016-06-30 9:13 ` Declan Doherty [this message]
2016-07-11 14:21 ` Thomas Monjalon
2016-06-29 13:15 Piotr Azarewicz
2016-06-30 10:46 ` Azarewicz, PiotrX T
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=4ea6fad1-ff5d-ff73-3200-7e92a7b92481@intel.com \
--to=declan.doherty@intel.com \
--cc=dev@dpdk.org \
--cc=piotrx.t.azarewicz@intel.com \
--cc=ptazarex@ecsmtp.igk.intel.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).