[v2,43/43] vdpa/sfc: use rte strerror

Message ID 20231114112407.3496460-44-huangdengdui@huawei.com (mailing list archive)
State Superseded, 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/iol-sample-apps-testing warning Testing issues
ci/github-robot: build fail github build: failed
ci/iol-compile-amd64-testing fail Testing issues
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-unit-arm64-testing fail Testing issues
ci/iol-compile-arm64-testing fail Testing issues
ci/Intel-compilation fail Compilation issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS

Commit Message

Dengdui Huang Nov. 14, 2023, 11:24 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>
---
 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;
 	}