netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] idpf: fix mismatched free function for dma_alloc_coherent
@ 2025-09-25 18:02 Alok Tiwari
  2025-09-26 14:03 ` Simon Horman
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Alok Tiwari @ 2025-09-25 18:02 UTC (permalink / raw)
  To: krishneil.k.singh, alan.brady, aleksander.lobakin, andrew+netdev,
	anthony.l.nguyen, przemyslaw.kitszel, davem, edumazet, kuba,
	pabeni, horms, netdev, intel-wired-lan
  Cc: alok.a.tiwari

The mailbox receive path allocates coherent DMA memory with
dma_alloc_coherent(), but frees it with dmam_free_coherent().
This is incorrect since dmam_free_coherent() is only valid for
buffers allocated with dmam_alloc_coherent().

Fix the mismatch by using dma_free_coherent() instead of
dmam_free_coherent

Fixes: e54232da1238 ("idpf: refactor idpf_recv_mb_msg")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 drivers/net/ethernet/intel/idpf/idpf_virtchnl.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
index 6330d4a0ae07..c1f34381333d 100644
--- a/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
+++ b/drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
@@ -702,9 +702,9 @@ int idpf_recv_mb_msg(struct idpf_adapter *adapter)
 		/* If post failed clear the only buffer we supplied */
 		if (post_err) {
 			if (dma_mem)
-				dmam_free_coherent(&adapter->pdev->dev,
-						   dma_mem->size, dma_mem->va,
-						   dma_mem->pa);
+				dma_free_coherent(&adapter->pdev->dev,
+						  dma_mem->size, dma_mem->va,
+						  dma_mem->pa);
 			break;
 		}
 
-- 
2.50.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-09-30  1:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-25 18:02 [PATCH net] idpf: fix mismatched free function for dma_alloc_coherent Alok Tiwari
2025-09-26 14:03 ` Simon Horman
2025-09-29  6:28 ` [Intel-wired-lan] " Loktionov, Aleksandr
2025-09-29 22:53 ` Jacob Keller
2025-09-29 23:07   ` Chittim, Madhu
2025-09-30  1:20 ` 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;
as well as URLs for NNTP newsgroup(s).