DMA Engine development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Markus Elfring" <Markus.Elfring@web.de>
Cc: vkoul@kernel.org, dmaengine@vger.kernel.org, Frank.Li@kernel.org
Subject: Re: [PATCH] dmaengine: ti: k3-udma: Use common error handling code in udma_prep_slave_sg_pkt()
Date: Wed, 10 Jun 2026 19:53:29 +0000	[thread overview]
Message-ID: <20260610195329.C8F431F00898@smtp.kernel.org> (raw)
In-Reply-To: <225b97d8-425c-46ea-bee2-df73753bca8c@web.de>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] The error handling label `free_hwdesc` is inappropriately placed inside an unrelated conditional block, creating non-linear control flow.
--

commit 8ea86eb1521c2e6195625764d7c02223ede1fd79
Author: Markus Elfring <elfring@users.sourceforge.net>

dmaengine: ti: k3-udma: Use common error handling code in udma_prep_slave_sg_pkt()

This commit introduces a new goto label to reuse error handling code when
descriptor allocation fails. The cleanup logic is now consolidated to avoid
duplication.

> diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c
> index c964ebfcf3b68..b56ee3ca848ef 100644
> --- a/drivers/dma/ti/k3-udma.c
> +++ b/drivers/dma/ti/k3-udma.c

[ ... ]

> @@ -3309,6 +3306,7 @@ udma_prep_slave_sg_pkt(struct udma_chan *uc, struct scatterlist *sgl,
>  		dev_err(uc->ud->dev,
>  			"%s: Transfer size %u is over the supported 4M range\n",
>  			__func__, d->residue);
> +free_hwdesc:

[Severity: Low]
Does placing this error handling label inside the unrelated residue bounds
check block create confusing control flow?

Jumping into the middle of the if (d->residue >= SZ_4M) block works currently,
but could it silently break the descriptor allocation error path if this
bounds check block is ever modified or removed in the future?

>  		udma_free_hwdesc(uc, d);
>  		kfree(d);
>  		return NULL;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/225b97d8-425c-46ea-bee2-df73753bca8c@web.de?part=1

      reply	other threads:[~2026-06-10 19:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-10 19:47 [PATCH] dmaengine: ti: k3-udma: Use common error handling code in udma_prep_slave_sg_pkt() Markus Elfring
2026-06-10 19:53 ` 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=20260610195329.C8F431F00898@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=Markus.Elfring@web.de \
    --cc=dmaengine@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