mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Xianwei Zhao <xianwei.zhao@amlogic.com>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	linux-amlogic@lists.infradead.org, dmaengine@vger.kernel.org
Subject: Re: [PATCH v2] dmaengine: amlogic: Fix missing destroy_workqueue() at error path in aml_dma_probe()
Date: Tue, 27 Oct 2026 11:22:29 +0800	[thread overview]
Message-ID: <c836dd3c-1ec5-4442-b892-53f849a2d31f@amlogic.com> (raw)
In-Reply-To: <13a835b1770e360af7991bb4c91ce52a8d01e331.1792785154.git.christophe.jaillet@wanadoo.fr>


Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>

On 2026/10/24 17:05, Christophe JAILLET wrote:
> If an error occurs after the alloc_ordered_workqueue() call, the
> corresponding memory is never released.
> 
> Use the managed version instead, as already done by most functions in the
> probe and simplify the remove function accordingly.
> 
> This avoids the leak.
> 
> Fixes: b84b5197e344 ("dmaengine: amlogic: Add general DMA driver for A9")
> Signed-off-by: Christophe JAILLET<christophe.jaillet@wanadoo.fr>
> ---
> Compile tested only.
> 
> Changes in v2:
>    - update the subject   [Franck Li]
> 
> v1:https://lore.kernel.org/lkml/93183551770e260aff993bb4cf1ce5ba8dc1e732.1792785154.git.christophe.jaillet@wanadoo.fr/
> ---
>   drivers/dma/amlogic-dma.c | 3 +--
>   1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/dma/amlogic-dma.c b/drivers/dma/amlogic-dma.c
> index 684121d13fca..791bd82743d3 100644
> --- a/drivers/dma/amlogic-dma.c
> +++ b/drivers/dma/amlogic-dma.c
> @@ -620,7 +620,7 @@ static int aml_dma_probe(struct platform_device *pdev)
>          if (!aml_dma)
>                  return -ENOMEM;
> 
> -       aml_dma->free_wq = alloc_ordered_workqueue("aml_dma_free", 0);
> +       aml_dma->free_wq = devm_alloc_ordered_workqueue(&pdev->dev, "aml_dma_free", 0);
>          if (!aml_dma->free_wq)
>                  return -ENOMEM;
> 
> @@ -712,7 +712,6 @@ static void aml_dma_remove(struct platform_device *pdev)
>                  if (aml_chan)
>                          tasklet_kill(&aml_chan->vchan.task);
>          }
> -       destroy_workqueue(aml_dma->free_wq);
>   }
> 
>   static const struct of_device_id aml_dma_ids[] = {

      parent reply	other threads:[~2026-10-27  3:22 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24  9:05 Christophe JAILLET
2026-10-26 16:53 ` Frank Li
2026-10-27  3:22 ` Xianwei Zhao [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=c836dd3c-1ec5-4442-b892-53f849a2d31f@amlogic.com \
    --to=xianwei.zhao@amlogic.com \
    --cc=Frank.Li@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dmaengine@vger.kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vkoul@kernel.org \
    /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®