From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Thomas Fourier <fourier.thomas@gmail.com>
Cc: "Anatolij Gustschin" <agust@denx.de>,
"Madhavan Srinivasan" <maddy@linux.ibm.com>,
"Michael Ellerman" <mpe@ellerman.id.au>,
"Nicholas Piggin" <npiggin@gmail.com>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"open list:LINUX FOR POWERPC EMBEDDED MPC5XXX"
<linuxppc-dev@lists.ozlabs.org>,
"open list" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] (powerpc/512) Fix possible `dma_unmap_single()` on uninitialized pointer
Date: Tue, 10 Jun 2025 18:37:22 +0200 [thread overview]
Message-ID: <88be9850-fa2e-4470-b54c-55b6b8e2dd29@csgroup.eu> (raw)
In-Reply-To: <20250610142918.169540-2-fourier.thomas@gmail.com>
Le 10/06/2025 à 16:29, Thomas Fourier a écrit :
> [Vous ne recevez pas souvent de courriers de fourier.thomas@gmail.com. Découvrez pourquoi ceci est important à https://aka.ms/LearnAboutSenderIdentification ]
>
> If the device configuration fails (if `dma_dev->device_config()`),
> `sg_dma_address(&sg)` is not initialized and the jump to `err_dma_prep`
> leads to calling `dma_unmap_single()` on `sg_dma_address(&sg)`.
>
> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>
> ---
> arch/powerpc/platforms/512x/mpc512x_lpbfifo.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> index 9668b052cd4b..f251e0f68262 100644
> --- a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> +++ b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> @@ -240,10 +240,8 @@ static int mpc512x_lpbfifo_kick(void)
> dma_conf.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES;
>
> /* Make DMA channel work with LPB FIFO data register */
> - if (dma_dev->device_config(lpbfifo.chan, &dma_conf)) {
> - ret = -EINVAL;
> - goto err_dma_prep;
> - }
> + if (dma_dev->device_config(lpbfifo.chan, &dma_conf))
> + return -EINVAL;
>
> sg_init_table(&sg, 1);
>
> --
> 2.43.0
>
prev parent reply other threads:[~2025-06-10 16:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 14:29 [PATCH v2] (powerpc/512) Fix possible `dma_unmap_single()` on uninitialized pointer Thomas Fourier
2025-06-10 16:37 ` Christophe Leroy [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=88be9850-fa2e-4470-b54c-55b6b8e2dd29@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=agust@denx.de \
--cc=fourier.thomas@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=npiggin@gmail.com \
--cc=u.kleine-koenig@baylibre.com \
/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