Skip to content
/ linux Public

Commit 1e300c3

Browse files
Thomas-fourierSasha Levin
authored andcommitted
net: ethernet: ec_bhf: Fix dma_free_coherent() dma handle
[ Upstream commit ffe68c3 ] 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: 6af55ff ("Driver for Beckhoff CX5020 EtherCAT master module.") Cc: <stable@vger.kernel.org> Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com> Link: https://patch.msgid.link/20260213164340.77272-2-fourier.thomas@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6ccfcad commit 1e300c3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/ec_bhf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ static int ec_bhf_open(struct net_device *net_dev)
424424

425425
error_rx_free:
426426
dma_free_coherent(dev, priv->rx_buf.alloc_len, priv->rx_buf.alloc,
427-
priv->rx_buf.alloc_len);
427+
priv->rx_buf.alloc_phys);
428428
out:
429429
return err;
430430
}

0 commit comments

Comments
 (0)