From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
Cc: dev@dpdk.org, alan.carew@intel.com
Subject: Re: [dpdk-dev] [PATCH] power: fix argument cannot be negative
Date: Mon, 16 May 2016 14:16:53 +0200 [thread overview]
Message-ID: <1965626.9JUMUNfzfm@xps13> (raw)
In-Reply-To: <1461163170-237505-1-git-send-email-danielx.t.mrzyglod@intel.com>
The title do not convey the real issue.
We should be more concerned by an issue of "wrong error message"
rather than an "argument" which "cannot be negative".
2016-04-20 16:39, Daniel Mrzyglod:
> Fix issue reported by Coverity.
> Coverity ID 13269 & 13266:
It is better to put these references below and start with the
explanation of the issue.
> Function strerror(errno) has built strings only for non-negative errno values.
> for negative values of errno it describe error as "Unknown error -errno"
> to be more descriptive i put string "channel not found" taken from header.
>
> The negative argument will be interpreted as a very large unsigned value.
OK.
The next statement is probably a useless copy paste of the coverity report.
> In send_msg: Negative value used as argument to a function expecting
> a positive value (for example, size of buffer or allocation)
Coverity issue: 13266
Coverity issue: 13269
> Fixes: 445c6528b55f ("power: common interface for guest and host")
>
> Signed-off-by: Daniel Mrzyglod <danielx.t.mrzyglod@intel.com>
[...]
> RTE_LOG(ERR, GUEST_CHANNEL, "Error on channel '%s' communications "
> - "test: %s\n", fd_path, strerror(ret));
> + "test: %s\n", fd_path, ret > 0 ? strerror(ret) :
> + "channel not connected");
The indent is messy. I sugest this:
+ RTE_LOG(ERR, GUEST_CHANNEL,
+ "Error on channel '%s' communications test: %s\n",
+ fd_path, ret > 0 ? strerror(ret) :
+ "channel not connected");
> - RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", strerror(ret));
> + RTE_LOG(DEBUG, POWER, "Error sending message: %s\n", ret > 0 ? strerror(ret)
> + : "channel not connected");
+ RTE_LOG(DEBUG, POWER, "Error sending message: %s\n",
+ ret > 0 ? strerror(ret) : "channel not connected");
Applied with above changes, thanks.
next prev parent reply other threads:[~2016-05-16 12:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-20 14:39 Daniel Mrzyglod
2016-05-16 12:16 ` Thomas Monjalon [this message]
2016-05-16 12:39 ` Mcnamara, John
2016-05-16 12:59 ` Thomas Monjalon
2016-05-16 13:03 ` Mcnamara, John
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=1965626.9JUMUNfzfm@xps13 \
--to=thomas.monjalon@6wind.com \
--cc=alan.carew@intel.com \
--cc=danielx.t.mrzyglod@intel.com \
--cc=dev@dpdk.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).