[v4,14/42] bus/vdev: use rte strerror

Message ID 20241023082852.2780488-15-huangdengdui@huawei.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series replace strerror |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

huangdengdui Oct. 23, 2024, 8:28 a.m. UTC
The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: stable@dpdk.org

Signed-off-by: Dengdui Huang <huangdengdui@huawei.com>
Acked-by: Chengwen Feng <fengchengwen@huawei.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 drivers/bus/vdev/vdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Patch

diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index ec7abe7cda..299f8c2873 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -437,7 +437,7 @@  vdev_action(const struct rte_mp_msg *mp_msg, const void *peer)
 			strlcpy(ou->name, devname, RTE_DEV_NAME_MAX_LEN);
 			if (rte_mp_sendmsg(&mp_resp) < 0)
 				VDEV_LOG(ERR, "send vdev, %s, failed, %s",
-					 devname, strerror(rte_errno));
+					 devname, rte_strerror(rte_errno));
 			num++;
 		}
 		rte_spinlock_recursive_unlock(&vdev_device_list_lock);