DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1] net/failsafe: fix strerror call in sub-eal
@ 2018-02-01 10:18 Gaetan Rivet
  2018-02-01 10:59 ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
  0 siblings, 1 reply; 3+ messages in thread
From: Gaetan Rivet @ 2018-02-01 10:18 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Gaetan Rivet

Ownership API returns a negative value, strerror expects a valid errno
value, thus positive.

CID 260401:  Error handling issues  (NEGATIVE_RETURNS)
"ret" is passed to a parameter that cannot be negative.

Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---
 drivers/net/failsafe/failsafe_eal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index 8946bf6fe..c3d673125 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -79,9 +79,9 @@ fs_bus_init(struct rte_eth_dev *dev)
 			      " %d named %s", i, da->name);
 		}
 		ret = rte_eth_dev_owner_set(pid, &PRIV(dev)->my_owner);
-		if (ret) {
+		if (ret < 0) {
 			INFO("sub_device %d owner set failed (%s),"
-			     " will try again later", i, strerror(ret));
+			     " will try again later", i, strerror(-ret));
 			continue;
 		} else if (strncmp(rte_eth_devices[pid].device->name, da->name,
 			   strlen(da->name)) != 0) {
-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [dpdk-dev] [PATCH v2] net/failsafe: fix strerror call in sub-eal
  2018-02-01 10:18 [dpdk-dev] [PATCH v1] net/failsafe: fix strerror call in sub-eal Gaetan Rivet
@ 2018-02-01 10:59 ` Gaetan Rivet
  2018-02-05 15:05   ` Ferruh Yigit
  0 siblings, 1 reply; 3+ messages in thread
From: Gaetan Rivet @ 2018-02-01 10:59 UTC (permalink / raw)
  To: dev; +Cc: Matan Azrad, Gaetan Rivet

Ownership API returns a negative value, strerror expects a valid errno
value, thus positive.

Coverity issue: 260401
Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves")

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
---

v2: Fix coverity reference syntax in commit log.

 drivers/net/failsafe/failsafe_eal.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/failsafe/failsafe_eal.c b/drivers/net/failsafe/failsafe_eal.c
index 8946bf6fe..c3d673125 100644
--- a/drivers/net/failsafe/failsafe_eal.c
+++ b/drivers/net/failsafe/failsafe_eal.c
@@ -79,9 +79,9 @@ fs_bus_init(struct rte_eth_dev *dev)
 			      " %d named %s", i, da->name);
 		}
 		ret = rte_eth_dev_owner_set(pid, &PRIV(dev)->my_owner);
-		if (ret) {
+		if (ret < 0) {
 			INFO("sub_device %d owner set failed (%s),"
-			     " will try again later", i, strerror(ret));
+			     " will try again later", i, strerror(-ret));
 			continue;
 		} else if (strncmp(rte_eth_devices[pid].device->name, da->name,
 			   strlen(da->name)) != 0) {
-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-dev] [PATCH v2] net/failsafe: fix strerror call in sub-eal
  2018-02-01 10:59 ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
@ 2018-02-05 15:05   ` Ferruh Yigit
  0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2018-02-05 15:05 UTC (permalink / raw)
  To: Gaetan Rivet, dev; +Cc: Matan Azrad

On 2/1/2018 10:59 AM, Gaetan Rivet wrote:
> Ownership API returns a negative value, strerror expects a valid errno
> value, thus positive.
> 
> Coverity issue: 260401
> Fixes: dcd0c9c32b8d ("net/failsafe: use ownership mechanism for slaves")
> 
> Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-05 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-01 10:18 [dpdk-dev] [PATCH v1] net/failsafe: fix strerror call in sub-eal Gaetan Rivet
2018-02-01 10:59 ` [dpdk-dev] [PATCH v2] " Gaetan Rivet
2018-02-05 15:05   ` Ferruh Yigit

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).