* [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
@ 2026-02-13 16:43 Thomas Fourier
2026-02-14 13:34 ` Markus Elfring
2026-02-18 1:30 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Thomas Fourier @ 2026-02-13 16:43 UTC (permalink / raw)
Cc: Thomas Fourier, stable, Dariusz Marcinkiewicz, Andrew Lunn,
David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
netdev, linux-kernel
dma_free_coherent() in error path takes priv->rx_buf.alloc_len as
the dma handle. This would lead to improper unmapping of the buffer.
Change the dma handle to priv->rx_buf.alloc_phys.
Fixes: 6af55ff52b02 ("Driver for Beckhoff CX5020 EtherCAT master module.")
Cc: <stable@vger.kernel.org>
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
---
drivers/net/ethernet/ec_bhf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ec_bhf.c b/drivers/net/ethernet/ec_bhf.c
index 67275aa4f65b..0c86cbb0313c 100644
--- a/drivers/net/ethernet/ec_bhf.c
+++ b/drivers/net/ethernet/ec_bhf.c
@@ -423,7 +423,7 @@ static int ec_bhf_open(struct net_device *net_dev)
error_rx_free:
dma_free_coherent(dev, priv->rx_buf.alloc_len, priv->rx_buf.alloc,
- priv->rx_buf.alloc_len);
+ priv->rx_buf.alloc_phys);
out:
return err;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
2026-02-13 16:43 [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Thomas Fourier
@ 2026-02-14 13:34 ` Markus Elfring
2026-02-18 1:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Markus Elfring @ 2026-02-14 13:34 UTC (permalink / raw)
To: Thomas Fourier, netdev
Cc: stable, LKML, Andrew Lunn, Dariusz Marcinkiewicz, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
> dma_free_coherent() in error path takes priv->rx_buf.alloc_len as
> the dma handle. This would lead to improper unmapping of the buffer.
>
> Change the dma handle to priv->rx_buf.alloc_phys.
* Were any source code analysis tools involved here?
* You should probably specify message recipients not only in the header field “Cc”.
Regards,
Markus
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
2026-02-13 16:43 [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Thomas Fourier
2026-02-14 13:34 ` Markus Elfring
@ 2026-02-18 1:30 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-02-18 1:30 UTC (permalink / raw)
To: Thomas Fourier
Cc: stable, reksio, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Fri, 13 Feb 2026 17:43:39 +0100 you wrote:
> dma_free_coherent() in error path takes priv->rx_buf.alloc_len as
> the dma handle. This would lead to improper unmapping of the buffer.
>
> Change the dma handle to priv->rx_buf.alloc_phys.
>
> Fixes: 6af55ff52b02 ("Driver for Beckhoff CX5020 EtherCAT master module.")
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
>
> [...]
Here is the summary with links:
- [net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
https://git.kernel.org/netdev/net/c/ffe68c376699
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-18 1:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-13 16:43 [PATCH net] net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle Thomas Fourier
2026-02-14 13:34 ` Markus Elfring
2026-02-18 1:30 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox