From: Dave Jiang <dave.jiang@intel.com>
To: WenTao Liang <vulab@iscas.ac.cn>, Jon Mason <jdmason@kudzu.us>,
Allen Hubbe <allenbh@gmail.com>,
linux-ntb@googlegroups.com
Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fix: ntb: perf_copy_chunk: fix tx descriptor and unmap kref leak on dmaengine_submit failure
Date: Fri, 26 Jun 2026 08:50:44 -0700 [thread overview]
Message-ID: <0d8051f0-a753-4e84-81be-39256cc44eef@intel.com> (raw)
In-Reply-To: <20260626153917.53128-1-vulab@iscas.ac.cn>
On 6/26/26 8:39 AM, WenTao Liang wrote:
> When dmaengine_submit fails after dma_set_unmap has been called, the
> unmap object has two references (one from dmaengine_get_unmap_data and
> one from dma_set_unmap held by the tx descriptor). The error path
> err_free_resource only calls dmaengine_unmap_put once, leaving the tx
> descriptor's reference and the descriptor itself leaked.
>
> Add dmaengine_desc_put(tx) in the err_free_resource path to properly
> release the tx descriptor and its held unmap reference.
>
> Cc: stable@vger.kernel.org
> Fixes: 282a2feeb9bf ("NTB: Use DMA Engine to Transmit and Receive")
> Signed-off-by: WenTao Liang <vulab@iscas.ac.cn>
Same comment. Please resend to ntb@lists.linux.dev.
> ---
> drivers/ntb/test/ntb_perf.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/ntb/test/ntb_perf.c b/drivers/ntb/test/ntb_perf.c
> index dfd175f79e8f..64783bfa5a2c 100644
> --- a/drivers/ntb/test/ntb_perf.c
> +++ b/drivers/ntb/test/ntb_perf.c
> @@ -851,6 +851,7 @@ static int perf_copy_chunk(struct perf_thread *pthr,
> return likely(atomic_read(&pthr->perf->tsync) > 0) ? 0 : -EINTR;
>
> err_free_resource:
> + dmaengine_desc_put(tx);
> dmaengine_unmap_put(unmap);
>
> return ret;
next prev parent reply other threads:[~2026-06-26 15:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-26 15:39 [PATCH] fix: ntb: perf_copy_chunk: fix tx descriptor and unmap kref leak on dmaengine_submit failure WenTao Liang
2026-06-26 15:50 ` Dave Jiang [this message]
2026-08-06 2:31 ` kernel test robot
2026-08-06 14:21 ` kernel test robot
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=0d8051f0-a753-4e84-81be-39256cc44eef@intel.com \
--to=dave.jiang@intel.com \
--cc=allenbh@gmail.com \
--cc=jdmason@kudzu.us \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-ntb@googlegroups.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.