Re: [PATCH v2 03/10] dmaengine: idxd: free the event log fault item when no record is copied
From: Frank Li
Date: Thu Dec 03 2026 - 12:48:15 EST
On Mon, Nov 30, 2026 at 11:47:14AM -0800, Daniel Byrne wrote:
> idxd_evl_fault_work() returns without freeing the fault object when a
> batch event log error entry has no completion record to copy, because
> the batch descriptor did not request one and no earlier fault in the
> batch failed its copy. That is the only path where the worker has
> nothing to do, and the only free of the object is at the end of the
> function, so one evl_cache object the size of an event log entry leaks
> per such entry. A user of the work queue drives it at submission rate,
> and kmem_cache_destroy() complains about the live objects when the
> device is unbound.
>
> Free the object on that path too.
>
> Fixes: 2442b7473ad0 ("dmaengine: idxd: process batch descriptor completion record faults")
> Cc: stable@xxxxxxxxxxxxxxx # 6.4+
> Signed-off-by: Daniel Byrne <daniel1.byrne@xxxxxxxxx>
> ---
Reviewed-by: Frank Li <Frank.Li@xxxxxxx>
> New in v2.
>
> drivers/dma/idxd/irq.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/dma/idxd/irq.c b/drivers/dma/idxd/irq.c
> index 65f3e389113c..9210a8a148fa 100644
> --- a/drivers/dma/idxd/irq.c
> +++ b/drivers/dma/idxd/irq.c
> @@ -264,7 +264,7 @@ static void idxd_evl_fault_work(struct work_struct *work)
> }
>
> if (copy_size == 0)
> - return;
> + goto out;
>
> /*
> * Copy completion record to fault_addr in user address space
> @@ -305,6 +305,7 @@ static void idxd_evl_fault_work(struct work_struct *work)
> break;
> }
>
> +out:
> kmem_cache_free(idxd->evl_cache, fault);
> }
>
> --
> 2.43.0
>