DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Devendra K Verma" <devverma@amd.com>
Cc: linux-pci@vger.kernel.org, vkoul@kernel.org, Frank.Li@kernel.org,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH RESEND v5 2/2] dmaengine: dw-edma: Add changes to support Channel Separation
Date: Mon, 07 Sep 2026 10:24:20 +0000	[thread overview]
Message-ID: <20260907102421.5641E1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260907101213.1917064-3-devverma@amd.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] IRQ vectors allocated by pci_alloc_irq_vectors() are leaked on multiple error paths and during device removal.
--

commit ba0a3a6c27ea5625a5bca375aac32fcdc517816e
Author: Devendra K Verma <devverma@amd.com>

dmaengine: dw-edma: Add changes to support Channel Separation

This commit updates the DMA channel register base address calculation to
support a configurable channel register space separation. It modifies the
probe functions to pass the channel space size to the chip structure.

> diff --git a/drivers/dma/dw-edma/dw-edma-pcie.c b/drivers/dma/dw-edma/dw-edma-pcie.c
> index 07931b1817856..fab4faf68b774 100644
> --- a/drivers/dma/dw-edma/dw-edma-pcie.c
> +++ b/drivers/dma/dw-edma/dw-edma-pcie.c

[ ... ]

> @@ -491,6 +494,7 @@ static int dw_edma_pcie_probe(struct pci_dev *pdev,
>  	chip->nr_irqs = nr_irqs;
>  	chip->ops = match->plat_ops;
>  	chip->cfg_non_ll = dma_data->cfg_non_ll;
> +	chip->ch_space_sz = dma_data->ch_space_sz;
>  
>  	chip->ll_wr_cnt = dma_data->wr_ch_cnt;
>  	chip->ll_rd_cnt = dma_data->rd_ch_cnt;

[Severity: High]
This is a pre-existing issue, but I noticed a potential resource leak in 
dw_edma_pcie_probe() regarding IRQ vector cleanup.

Does dw_edma_pcie_probe() leak IRQ vectors on error paths and during device
removal?

Earlier in dw_edma_pcie_probe(), vectors are allocated using
pci_alloc_irq_vectors(). However, multiple error paths after this point
return directly without calling pci_free_irq_vectors(). For example, if
pcim_iomap_table() fails:

    chip->reg_base = pcim_iomap_table(pdev)[dma_data->rg.bar];
    if (!chip->reg_base)
        return -ENOMEM;

Similar leaks appear to happen if allocating the logical link blocks fails,
or if dw_edma_probe() fails near the end of the function.

Furthermore, dw_edma_pcie_remove() does not appear to call
pci_free_irq_vectors(), which means these IRQ vectors are leaked when the
device is unbound or the module is unloaded. 

According to PCI subsystem guidelines, every error path after a successful
allocation must clean up the vectors to prevent IRQ resource exhaustion.
Could we add proper error labels to clean up these vectors?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260907101213.1917064-1-devverma@amd.com?part=2

      reply	other threads:[~2026-09-07 10:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07 10:12 [PATCH RESEND v5 0/2] CPM6 Channel Separation Support Devendra K Verma
2026-09-07 10:12 ` [PATCH RESEND v5 1/2] dmaengine: dw-edma: Enable Chan Separation via VSEC Devendra K Verma
2026-09-07 10:19   ` sashiko-bot
2026-09-07 10:12 ` [PATCH RESEND v5 2/2] dmaengine: dw-edma: Add changes to support Channel Separation Devendra K Verma
2026-09-07 10:24   ` sashiko-bot [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=20260907102421.5641E1F00A3A@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=devverma@amd.com \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --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