> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Alok Tiwari
> Sent: Thursday, September 25, 2025 8:02 PM
> To: Singh, Krishneil K <[email protected]>;
> [email protected]; Lobakin, Aleksander
> <[email protected]>; [email protected]; Nguyen, Anthony
> L <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; [email protected];
> [email protected]; [email protected]; [email protected];
> [email protected]; [email protected]; intel-wired-
> [email protected]
> Cc: [email protected]
> Subject: [Intel-wired-lan] [PATCH net] 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: e54232da1238 ("idpf: refactor idpf_recv_mb_msg")
> Signed-off-by: Alok Tiwari <[email protected]>
> ---
>  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

Reviewed-by: Aleksandr Loktionov <[email protected]>

Reply via email to