From: Greg KH <gregkh@linuxfoundation.org>
To: WenTao Liang <vulab@iscas.ac.cn>
Cc: ntb@lists.linux.dev, jdmason@kudzu.us, dave.jiang@intel.com,
allenbh@gmail.com, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v2] ntb: fix tx descriptor leak on dmaengine_submit failure
Date: Mon, 29 Jun 2026 06:37:11 +0200 [thread overview]
Message-ID: <2026062901-slather-filing-3fc4@gregkh> (raw)
In-Reply-To: <20260628083301.9781-1-vulab@iscas.ac.cn>
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@linuxfoundation.org>
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
prev parent reply other threads:[~2026-06-29 4:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-28 8:33 [PATCH v2] ntb: fix tx descriptor leak on dmaengine_submit failure WenTao Liang
2026-06-29 4:37 ` Greg KH [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2026062901-slather-filing-3fc4@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=allenbh@gmail.com \
--cc=dave.jiang@intel.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=ntb@lists.linux.dev \
--cc=stable@vger.kernel.org \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox