Skip to content

Commit b9bd25f

Browse files
aloktiwakuba-moo
authored andcommitted
idpf: fix mismatched free function for dma_alloc_coherent
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: e54232d ("idpf: refactor idpf_recv_mb_msg") Signed-off-by: Alok Tiwari <[email protected]> Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Aleksandr Loktionov <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Madhu Chittim <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 012ea48 commit b9bd25f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/net/ethernet/intel/idpf/idpf_virtchnl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -702,9 +702,9 @@ int idpf_recv_mb_msg(struct idpf_adapter *adapter)
702702
/* If post failed clear the only buffer we supplied */
703703
if (post_err) {
704704
if (dma_mem)
705-
dmam_free_coherent(&adapter->pdev->dev,
706-
dma_mem->size, dma_mem->va,
707-
dma_mem->pa);
705+
dma_free_coherent(&adapter->pdev->dev,
706+
dma_mem->size, dma_mem->va,
707+
dma_mem->pa);
708708
break;
709709
}
710710

0 commit comments

Comments
 (0)