* [PATCH v1 1/2] bus/cdx: fix empty device string in error message
@ 2025-10-24 9:53 Anatoly Burakov
2025-10-24 9:53 ` [PATCH v1 2/2] bus/cdx: fix incorrect device release on error Anatoly Burakov
0 siblings, 1 reply; 2+ messages in thread
From: Anatoly Burakov @ 2025-10-24 9:53 UTC (permalink / raw)
To: dev, Nipun Gupta, Nikhil Agarwal, Ferruh Yigit; +Cc: stable
The variable cdx_addr is a stack-allocated zero-initialized char array, but
it is never used anywhere, except as part of error message out. The
intention is to display device name, so fix the code to reflect that.
Fixes: 45ef232af515 ("bus/cdx: introduce AMD CDX bus")
Cc: nipun.gupta@amd.com
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/bus/cdx/cdx_vfio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index c03bc01df7..a3cf53b6a6 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -389,7 +389,6 @@ static int
cdx_vfio_map_resource_primary(struct rte_cdx_device *dev)
{
struct vfio_device_info device_info = { .argsz = sizeof(device_info) };
- char cdx_addr[PATH_MAX] = {0};
static void *cdx_map_addr;
struct mapped_cdx_resource *vfio_res = NULL;
struct mapped_cdx_res_list *vfio_res_list =
@@ -455,7 +454,7 @@ cdx_vfio_map_resource_primary(struct rte_cdx_device *dev)
ret = cdx_vfio_mmap_resource(vfio_dev_fd, vfio_res, i, 0);
if (ret < 0) {
CDX_BUS_ERR("%s mapping region %i failed: %s",
- cdx_addr, i, strerror(errno));
+ dev_name, i, strerror(errno));
free(reg);
goto err_vfio_res;
}
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v1 2/2] bus/cdx: fix incorrect device release on error
2025-10-24 9:53 [PATCH v1 1/2] bus/cdx: fix empty device string in error message Anatoly Burakov
@ 2025-10-24 9:53 ` Anatoly Burakov
0 siblings, 0 replies; 2+ messages in thread
From: Anatoly Burakov @ 2025-10-24 9:53 UTC (permalink / raw)
To: dev, Nipun Gupta, Nikhil Agarwal, Ferruh Yigit; +Cc: stable
The variable cdx_addr is a stack-allocated zero-initialized char array, but
it is never used anywhere except in an error handler to stand it as a
device bus address for a VFIO device release call. This is incorrect, as it
should have been actual device address, so fix the code to reflect that.
Fixes: 45ef232af515 ("bus/cdx: introduce AMD CDX bus")
Cc: nipun.gupta@amd.com
Cc: stable@dpdk.org
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/bus/cdx/cdx_vfio.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/bus/cdx/cdx_vfio.c b/drivers/bus/cdx/cdx_vfio.c
index a3cf53b6a6..11fe3265d2 100644
--- a/drivers/bus/cdx/cdx_vfio.c
+++ b/drivers/bus/cdx/cdx_vfio.c
@@ -485,7 +485,6 @@ static int
cdx_vfio_map_resource_secondary(struct rte_cdx_device *dev)
{
struct vfio_device_info device_info = { .argsz = sizeof(device_info) };
- char cdx_addr[PATH_MAX] = {0};
int vfio_dev_fd;
int i, ret;
struct mapped_cdx_resource *vfio_res = NULL;
@@ -536,7 +535,7 @@ cdx_vfio_map_resource_secondary(struct rte_cdx_device *dev)
return 0;
err_vfio_dev_fd:
- rte_vfio_release_device(RTE_CDX_BUS_DEVICES_PATH, cdx_addr, vfio_dev_fd);
+ rte_vfio_release_device(RTE_CDX_BUS_DEVICES_PATH, dev_name, vfio_dev_fd);
return -1;
}
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-10-24 9:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-10-24 9:53 [PATCH v1 1/2] bus/cdx: fix empty device string in error message Anatoly Burakov
2025-10-24 9:53 ` [PATCH v1 2/2] bus/cdx: fix incorrect device release on error Anatoly Burakov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).