netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacob Keller <jacob.e.keller@intel.com>
To: Alok Tiwari <alok.a.tiwari@oracle.com>,
	<krishneil.k.singh@intel.com>, <alan.brady@intel.com>,
	<aleksander.lobakin@intel.com>, <andrew+netdev@lunn.ch>,
	<anthony.l.nguyen@intel.com>, <przemyslaw.kitszel@intel.com>,
	<davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>,
	<pabeni@redhat.com>, <horms@kernel.org>, <netdev@vger.kernel.org>,
	<intel-wired-lan@lists.osuosl.org>,
	"Tantilov, Emil S" <emil.s.tantilov@intel.com>,
	Joshua Hay <joshua.a.hay@intel.com>
Subject: Re: [Intel-wired-lan] [PATCH net] idpf: fix mismatched free function for dma_alloc_coherent
Date: Mon, 29 Sep 2025 15:53:40 -0700	[thread overview]
Message-ID: <1dda14ca-7e58-448e-8b05-e5f6293911f0@intel.com> (raw)
In-Reply-To: <20250925180212.415093-1-alok.a.tiwari@oracle.com>


[-- Attachment #1.1: Type: text/plain, Size: 1833 bytes --]



On 9/25/2025 11:02 AM, Alok Tiwari wrote:
> 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>
> ---

This is tagged for net, not iwl-net. The fix seems obvious to me, and
unlikely to be covered well by validation tests, due to being an error
cleanup flow.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

I don't have an issue with this being taken directly to net, but would
appreciate an ACK by someone from the idpf driver team first to make
sure we're in agreement. Alternatively, if anyone has objection and
would prefer I pick this up for IWL net dev-queue, please let me know.


>  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;
>  		}
>  


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]

  parent reply	other threads:[~2025-09-29 22:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2025-09-29 23:07   ` Chittim, Madhu
2025-09-30  1:20 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1dda14ca-7e58-448e-8b05-e5f6293911f0@intel.com \
    --to=jacob.e.keller@intel.com \
    --cc=alan.brady@intel.com \
    --cc=aleksander.lobakin@intel.com \
    --cc=alok.a.tiwari@oracle.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=anthony.l.nguyen@intel.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=emil.s.tantilov@intel.com \
    --cc=horms@kernel.org \
    --cc=intel-wired-lan@lists.osuosl.org \
    --cc=joshua.a.hay@intel.com \
    --cc=krishneil.k.singh@intel.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=przemyslaw.kitszel@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).