[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <fbe9378a-f3f0-4398-b91b-dd3713c0be5e@csgroup.eu>
Date: Mon, 9 Jun 2025 09:40:46 +0200
From: Christophe Leroy <christophe.leroy@...roup.eu>
To: Thomas Fourier <fourier.thomas@...il.com>
Cc: Anatolij Gustschin <agust@...x.de>,
Madhavan Srinivasan <maddy@...ux.ibm.com>,
Michael Ellerman <mpe@...erman.id.au>, Nicholas Piggin <npiggin@...il.com>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Uwe Kleine-König <u.kleine-koenig@...libre.com>,
"open list:LINUX FOR POWERPC EMBEDDED MPC5XXX"
<linuxppc-dev@...ts.ozlabs.org>, open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] (powerpc/512) Fix possible `dma_unmap_single()` on
uninitialized pointer
Le 05/06/2025 à 18:37, Thomas Fourier a écrit :
> [Vous ne recevez pas souvent de courriers de fourier.thomas@...il.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@...il.com>
> ---
> arch/powerpc/platforms/512x/mpc512x_lpbfifo.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> index 9668b052cd4b..ef3be438f914 100644
> --- a/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> +++ b/arch/powerpc/platforms/512x/mpc512x_lpbfifo.c
> @@ -241,8 +241,7 @@ static int mpc512x_lpbfifo_kick(void)
>
> /* Make DMA channel work with LPB FIFO data register */
> if (dma_dev->device_config(lpbfifo.chan, &dma_conf)) {
> - ret = -EINVAL;
> - goto err_dma_prep;
> + return -EINVAL;
> }
You should remove the { } as it is now a single line.
>
> sg_init_table(&sg, 1);
> --
> 2.43.0
>
Powered by blists - more mailing lists