mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <krzk@kernel.org>
To: Haotian Zhang <vulab@iscas.ac.cn>, Vinod Koul <vkoul@kernel.org>,
	Frank Li <Frank.Li@kernel.org>, Dan Williams <djbw@kernel.org>,
	Maciej Sosnowski <maciej.sosnowski@intel.com>
Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: ioat: fix completion pool leak on ring allocation failure
Date: Fri, 9 Oct 2026 07:55:37 +0200	[thread overview]
Message-ID: <78844b0c-f77d-4e01-955b-e278573d6998@kernel.org> (raw)
In-Reply-To: <20261009043229.3108794-1-vulab@iscas.ac.cn>

On 09/10/2026 06:32, Haotian Zhang wrote:
> ioat_alloc_chan_resources() allocates the channel completion writeback
> area with dma_pool_zalloc() and then allocates the descriptor ring with
> ioat_alloc_ring().  The ring allocation runs under GFP_NOWAIT and can
> fail, in which case the function returns -ENOMEM without freeing the
> completion area.  As the ring pointer stays NULL, the only teardown path,
> ioat_free_chan_resources(), bails out early and never releases it; a
> subsequent retry overwrites ioat_chan->completion, leaking the previous
> allocation permanently.  The dmaengine core does not call
> device_free_chan_resources() when device_alloc_chan_resources() fails, so
> nothing else cleans it up either.
> 
> Release the completion area with dma_pool_free() before returning from the
> ring allocation error path.
> 
> Fixes: 5cbafa65b92e ("ioat2,3: convert to a true ring buffer")
> Assisted-by: DeepSeek-V4.1-Flash
> Signed-off-by: Haotian Zhang <vulab@iscas.ac.cn>
> ---

So you completely ignored previous emails and discussions, right?

Best regards,
Krzysztof

  reply	other threads:[~2026-10-09  5:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09  4:32 Haotian Zhang
2026-10-09  5:55 ` Krzysztof Kozlowski [this message]
2026-10-09  6:09 ` Krzysztof Kozlowski

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=78844b0c-f77d-4e01-955b-e278573d6998@kernel.org \
    --to=krzk@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=djbw@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maciej.sosnowski@intel.com \
    --cc=vkoul@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

all inboxes | Powered by JetHome®