Re: [PATCH v2] dmaengine: nbpfaxi: Fix setting channel irqs in probe()
From: Dan Carpenter
Date: Thu Jul 09 2026 - 06:43:18 EST
On Thu, Jul 02, 2026 at 05:28:03PM +0200, Christian Taedcke via B4 Relay wrote:
> diff --git a/drivers/dma/nbpfaxi.c b/drivers/dma/nbpfaxi.c
> index 05d7321629cc..bcfab62a71d7 100644
> --- a/drivers/dma/nbpfaxi.c
> +++ b/drivers/dma/nbpfaxi.c
> @@ -1374,14 +1374,12 @@ static int nbpf_probe(struct platform_device *pdev)
> if (irqs == num_channels + 1) {
> struct nbpf_channel *chan;
>
> - for (i = 0, chan = nbpf->chan; i < num_channels;
> - i++, chan++) {
> + for (i = 0, chan = nbpf->chan; i < irqs; i++) {
> /* Skip the error IRQ */
> if (irqbuf[i] == eirq)
> - i++;
> - if (i >= ARRAY_SIZE(irqbuf))
> - return -EINVAL;
> + continue;
> chan->irq = irqbuf[i];
> + chan++;
If we don't hit the continue then this could still corrupt memory.
regards,
dan carpenter