Re: [PATCH v2] ntb: fix tx descriptor leak on dmaengine_submit failure
From: Greg KH
Date: Mon Jun 29 2026 - 00:38:31 EST
On Sun, Jun 28, 2026 at 04:33:01PM +0800, WenTao Liang wrote:
> When dmaengine_submit fails after dma_set_unmap has been called, the
> error path err_set_unmap only calls dmaengine_unmap_put once, but the
> unmap object has two references (one from dmaengine_get_unmap_data and
> one from dma_set_unmap held by the tx descriptor). The tx descriptor
> itself is never freed, so its reference to unmap is never released,
> causing a kref leak and a dangling pointer in the freed descriptor.
>
> Replace dmaengine_unmap_put with dmaengine_desc_put(txd) in the
> err_set_unmap path to properly release the tx descriptor, which will also
> drop the unmap reference it holds.
>
> Suggested-by: Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx>
No, I didn't suggest ANY of these patches.
Also you did not use Assisted-by:, why?
Please start small with just 1 patch that you can do properly, before
flooding us with lots.
Please go and reply to all of these where you incorrectly added my
suggested-by and ask for them to be dropped.
greg k-h