[v1] lib/power: fix incorrect parameter to strerror

Message ID 20191125150042.12340-1-david.hunt@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v1] lib/power: fix incorrect parameter to strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-compilation success Compile Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot warning Travis build: failed

Commit Message

Hunt, David Nov. 25, 2019, 3 p.m. UTC
  Should be passing errno rather than ret, which could be negative.

Coverity issue: 350362
Fixes: 9dc843eb273b ("power: extend guest channel API for reading")
Cc: stable@dpdk.org

Signed-off-by: David Hunt <david.hunt@intel.com>
---
 lib/librte_power/guest_channel.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Nov. 25, 2019, 11:27 p.m. UTC | #1
25/11/2019 16:00, David Hunt:
> Should be passing errno rather than ret, which could be negative.
> 
> Coverity issue: 350362
> Fixes: 9dc843eb273b ("power: extend guest channel API for reading")
> Cc: stable@dpdk.org
> 
> Signed-off-by: David Hunt <david.hunt@intel.com>

Applied, thanks
  

Patch

diff --git a/lib/librte_power/guest_channel.c b/lib/librte_power/guest_channel.c
index 439cd2f38..b984d55bc 100644
--- a/lib/librte_power/guest_channel.c
+++ b/lib/librte_power/guest_channel.c
@@ -148,7 +148,7 @@  int power_guest_channel_read_msg(void *pkt,
 		return -1;
 	} else if (ret < 0) {
 		RTE_LOG(ERR, GUEST_CHANNEL, "Error occurred during poll function: %s\n",
-				strerror(ret));
+				strerror(errno));
 		return -1;
 	}