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(-)
@@ -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, ®);
if (ret != 0) {
sfc_vdpa_err(dev, "could not get device region info: %s",
- strerror(errno));
+ rte_strerror(errno));
return ret;
}