[v4,42/42] vdpa/sfc: use rte strerror

Message ID 20241023082852.2780488-43-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
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues
ci/intel-Testing success Testing PASS
ci/github-robot: build success github build: passed
ci/intel-Functional success Functional PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-marvell-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-unit-arm64-testing warning Testing issues
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing fail Testing issues
ci/iol-sample-apps-testing success Testing PASS

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/vdpa/sfc/sfc_vdpa_ops.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Patch

diff --git a/drivers/vdpa/sfc/sfc_vdpa_ops.c b/drivers/vdpa/sfc/sfc_vdpa_ops.c
index 00f9a4b04c..56fb7f96d8 100644
--- a/drivers/vdpa/sfc/sfc_vdpa_ops.c
+++ b/drivers/vdpa/sfc/sfc_vdpa_ops.c
@@ -137,7 +137,7 @@  sfc_vdpa_enable_vfio_intr(struct sfc_vdpa_ops_data *ops_data)
 	if (rc) {
 		sfc_vdpa_err(ops_data->dev_handle,
 			     "error enabling MSI-X interrupts: %s",
-			     strerror(errno));
+			     rte_strerror(errno));
 		return -1;
 	}
 
@@ -165,7 +165,7 @@  sfc_vdpa_disable_vfio_intr(struct sfc_vdpa_ops_data *ops_data)
 	if (rc) {
 		sfc_vdpa_err(ops_data->dev_handle,
 			     "error disabling MSI-X interrupts: %s",
-			     strerror(errno));
+			     rte_strerror(errno));
 		return -1;
 	}
 
@@ -841,7 +841,7 @@  sfc_vdpa_get_notify_area(int vid, int qid, uint64_t *offset, uint64_t *size)
 	ret = ioctl(vfio_dev_fd, VFIO_DEVICE_GET_REGION_INFO, &reg);
 	if (ret != 0) {
 		sfc_vdpa_err(dev, "could not get device region info: %s",
-			     strerror(errno));
+			     rte_strerror(errno));
 		return ret;
 	}