Skip to content

Commit ad13df8

Browse files
anatolyburakovdavid-marchand
authored andcommitted
bus/cdx: fix release in probing for secondary process
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: 45ef232 ("bus/cdx: introduce AMD CDX bus") Cc: [email protected] Signed-off-by: Anatoly Burakov <[email protected]> Acked-by: Nipun Gupta <[email protected]>
1 parent ebd507b commit ad13df8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/bus/cdx/cdx_vfio.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,6 @@ static int
485485
cdx_vfio_map_resource_secondary(struct rte_cdx_device *dev)
486486
{
487487
struct vfio_device_info device_info = { .argsz = sizeof(device_info) };
488-
char cdx_addr[PATH_MAX] = {0};
489488
int vfio_dev_fd;
490489
int i, ret;
491490
struct mapped_cdx_resource *vfio_res = NULL;
@@ -536,7 +535,7 @@ cdx_vfio_map_resource_secondary(struct rte_cdx_device *dev)
536535

537536
return 0;
538537
err_vfio_dev_fd:
539-
rte_vfio_release_device(RTE_CDX_BUS_DEVICES_PATH, cdx_addr, vfio_dev_fd);
538+
rte_vfio_release_device(RTE_CDX_BUS_DEVICES_PATH, dev_name, vfio_dev_fd);
540539
return -1;
541540
}
542541

0 commit comments

Comments
 (0)