From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7371143329; Tue, 14 Nov 2023 12:25:52 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4C48440DF5; Tue, 14 Nov 2023 12:24:30 +0100 (CET) Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by mails.dpdk.org (Postfix) with ESMTP id CA201402E4 for ; Tue, 14 Nov 2023 12:24:11 +0100 (CET) Received: from dggpeml500011.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4SV3kp6CcPzmXFD; Tue, 14 Nov 2023 19:20:50 +0800 (CST) Received: from localhost.huawei.com (10.50.165.33) by dggpeml500011.china.huawei.com (7.185.36.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Tue, 14 Nov 2023 19:24:09 +0800 From: Dengdui Huang To: CC: , , , , Subject: [PATCH v2 13/43] bus/fslmc: use rte strerror Date: Tue, 14 Nov 2023 19:23:37 +0800 Message-ID: <20231114112407.3496460-14-huangdengdui@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20231114112407.3496460-1-huangdengdui@huawei.com> References: <20231114082539.1858594-44-huangdengdui@huawei.com> <20231114112407.3496460-1-huangdengdui@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.50.165.33] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500011.china.huawei.com (7.185.36.84) X-CFilter-Loop: Reflected X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 Acked-by: Chengwen Feng --- drivers/bus/fslmc/fslmc_vfio.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/bus/fslmc/fslmc_vfio.c b/drivers/bus/fslmc/fslmc_vfio.c index 5966776a85..1cbbcf9019 100644 --- a/drivers/bus/fslmc/fslmc_vfio.c +++ b/drivers/bus/fslmc/fslmc_vfio.c @@ -481,7 +481,7 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr, if (ret) { DPAA2_BUS_ERR(" %s cannot get group status, " "error %i (%s)\n", dev_addr, - errno, strerror(errno)); + errno, rte_strerror(errno)); close(vfio_group_fd); rte_vfio_clear_group(vfio_group_fd); return -1; @@ -504,7 +504,7 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr, if (ret) { DPAA2_BUS_ERR(" %s cannot add VFIO group to container, " "error %i (%s)\n", dev_addr, - errno, strerror(errno)); + errno, rte_strerror(errno)); close(vfio_group_fd); close(vfio_container_fd); rte_vfio_clear_group(vfio_group_fd); @@ -551,7 +551,7 @@ fslmc_vfio_setup_device(const char *sysfs_base, const char *dev_addr, ret = ioctl(*vfio_dev_fd, VFIO_DEVICE_GET_INFO, device_info); if (ret) { DPAA2_BUS_ERR(" %s cannot get device info, error %i (%s)", - dev_addr, errno, strerror(errno)); + dev_addr, errno, rte_strerror(errno)); close(*vfio_dev_fd); close(vfio_group_fd); close(vfio_container_fd); @@ -617,7 +617,7 @@ int rte_dpaa2_intr_enable(struct rte_intr_handle *intr_handle, int index) if (ret) { DPAA2_BUS_ERR("Error:dpaa2 SET IRQs fd=%d, err = %d(%s)", rte_intr_fd_get(intr_handle), errno, - strerror(errno)); + rte_strerror(errno)); return ret; } @@ -667,7 +667,7 @@ rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle, ret = ioctl(vfio_dev_fd, VFIO_DEVICE_GET_IRQ_INFO, &irq_info); if (ret < 0) { DPAA2_BUS_ERR("Cannot get IRQ(%d) info, error %i (%s)", - i, errno, strerror(errno)); + i, errno, rte_strerror(errno)); return -1; } @@ -682,7 +682,7 @@ rte_dpaa2_vfio_setup_intr(struct rte_intr_handle *intr_handle, fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC); if (fd < 0) { DPAA2_BUS_ERR("Cannot set up eventfd, error %i (%s)", - errno, strerror(errno)); + errno, rte_strerror(errno)); return -1; } -- 2.33.0