[PATCH 24.11] bus/fslmc: fix interrupt leak in DPIO cleanup
David Marchand
david.marchand at redhat.com
Tue Nov 10 19:02:24 CET 2026
[ upstream commit 7495d45fb26e8610095cb1979f5e3f537c3913d7 ]
The interrupt handle in the DPIO device is separate from the bus device
object handle. The cleanup code was leaking this handle and the FD it
carries.
Fixes: 274fd921ff7f ("bus/fslmc: support close operation")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Acked-by: Hemant Agrawal <hemant.agrawal at nxp.com>
---
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index bc03b4dd05..b53ebee3d3 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -400,6 +400,13 @@ dpaa2_close_dpio_device(int object_id)
rte_free(dpio_dev->dpio);
}
TAILQ_REMOVE(&dpio_dev_list, dpio_dev, next);
+ if (rte_intr_fd_get(dpio_dev->intr_handle) >= 0) {
+ close(rte_intr_fd_get(dpio_dev->intr_handle));
+ rte_intr_fd_set(dpio_dev->intr_handle, -1);
+ }
+ /* dev_fd is closed by caller, clear reference here. */
+ rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
+ rte_intr_instance_free(dpio_dev->intr_handle);
rte_free(dpio_dev);
}
}
@@ -592,6 +599,12 @@ dpaa2_create_dpio_device(int vdev_fd,
rte_free(dpio_dev->dpio);
}
+ if (rte_intr_fd_get(dpio_dev->intr_handle) >= 0) {
+ close(rte_intr_fd_get(dpio_dev->intr_handle));
+ rte_intr_fd_set(dpio_dev->intr_handle, -1);
+ }
+ /* dev_fd is closed by caller, clear reference here. */
+ rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
rte_intr_instance_free(dpio_dev->intr_handle);
rte_free(dpio_dev);
@@ -604,6 +617,12 @@ dpaa2_create_dpio_device(int vdev_fd,
dpio_dev->token);
rte_free(dpio_dev->dpio);
}
+ if (rte_intr_fd_get(dpio_dev->intr_handle) >= 0) {
+ close(rte_intr_fd_get(dpio_dev->intr_handle));
+ rte_intr_fd_set(dpio_dev->intr_handle, -1);
+ }
+ /* dev_fd is closed by caller, clear reference here. */
+ rte_intr_dev_fd_set(dpio_dev->intr_handle, -1);
rte_intr_instance_free(dpio_dev->intr_handle);
rte_free(dpio_dev);
}
--
2.56.0
More information about the stable
mailing list