[v4,34/42] net/qede: use rte strerror

Message ID 20241023082852.2780488-35-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/net/qede/qede_regs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/qede/qede_regs.c b/drivers/net/qede/qede_regs.c
index d2ea1c9108..3aa31a42c2 100644
--- a/drivers/net/qede/qede_regs.c
+++ b/drivers/net/qede/qede_regs.c
@@ -221,7 +221,7 @@  qede_write_fwdump(const char *dump_file, void *dump, size_t len)
 
 	if (!f) {
 		fprintf(stderr, "Can't open file %s: %s\n",
-			dump_file, strerror(errno));
+			dump_file, rte_strerror(errno));
 		return 1;
 	}
 	bytes = fwrite(dump, 1, len, f);
@@ -234,7 +234,7 @@  qede_write_fwdump(const char *dump_file, void *dump, size_t len)
 
 	if (fclose(f)) {
 		fprintf(stderr, "Can't close file %s: %s\n",
-			dump_file, strerror(errno));
+			dump_file, rte_strerror(errno));
 		err = 1;
 	}