[dpdk-dev] [PATCH] net/mlx5: fix error message in probe function

Adrien Mazarguil adrien.mazarguil at 6wind.com
Fri May 25 18:15:36 CEST 2018


Error values passed to strerror() must be positive.

Fixes: 012ad9944dfc ("net/mlx5: fix probe return value polarity")
Cc: Shahaf Shuler <shahafs at mellanox.com>

Signed-off-by: Adrien Mazarguil <adrien.mazarguil at 6wind.com>
---
 drivers/net/mlx5/mlx5.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c
index 11b395b64..9b78f9879 100644
--- a/drivers/net/mlx5/mlx5.c
+++ b/drivers/net/mlx5/mlx5.c
@@ -953,9 +953,9 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		priv->mtu = ETHER_MTU;
 		err = mlx5_args(&config, pci_dev->device.devargs);
 		if (err) {
-			DRV_LOG(ERR, "failed to process device arguments: %s",
-				strerror(err));
 			err = rte_errno;
+			DRV_LOG(ERR, "failed to process device arguments: %s",
+				strerror(rte_errno));
 			goto port_error;
 		}
 		err = mlx5_glue->query_device_ex(ctx, NULL, &device_attr_ex);
-- 
2.11.0


More information about the dev mailing list