The function strerror() is insecure in a multi-thread environment.
This patch uses rte_strerror() to replace it.

Cc: sta...@dpdk.org

Signed-off-by: Dengdui Huang <huangdeng...@huawei.com>
Acked-by: Chengwen Feng <fengcheng...@huawei.com>
Acked-by: Morten Brørup <m...@smartsharesystems.com>
---
 drivers/net/qede/qede_regs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
        }
 
-- 
2.33.0

Reply via email to