Skip to content

Commit 7e54ff9

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 79f5265 commit 7e54ff9

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
@@ -423,7 +423,7 @@ static int ec_bhf_open(struct net_device *net_dev)
423423

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

0 commit comments

Comments
 (0)