linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: esben@geanix.com
Cc: Jonas Suhr Christensen <jsc@umbraculum.org>,
	netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
	pabeni@redhat.com, michal.simek@xilinx.com,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] net: ll_temac: improve reset of buffer on dma mapping
Date: Mon, 30 Jan 2023 12:42:15 -0800	[thread overview]
Message-ID: <20230130124215.1a06c5af@kernel.org> (raw)
In-Reply-To: <87edrc8aav.fsf@geanix.com>

On Mon, 30 Jan 2023 13:40:56 +0100 esben@geanix.com wrote:
> > On Thu, 26 Jan 2023 11:16:07 +0100 Jonas Suhr Christensen wrote:  
> >> Free buffer and set pointer to null on dma mapping error.  
> >
> > Why? I don't see a leak. You should provide motivation in the commit
> > message.  
> 
> I don't think there is a leak.  But if one of the dma_map_single() calls
> in temac_dma_bd_init() fails, the error handling calls into
> temac_dma_bd_release(), which will then call dma_unmap_single() on the
> address that failed to be mapped.

I see, seems worth fixing. Please explain that in the commit message,
it's not immediately clear what the concern is, otherwise.
On top of that please add a Fixes tag here as well and repost.

> Can we be sure that doing so is always safe?  If not, this change
> ensures that we only unmap buffers that were succesfully mapped.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2023-01-30 20:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-26 10:16 [PATCH 1/2] net: ll_temac: fix DMA resources leak Jonas Suhr Christensen
2023-01-26 10:16 ` [PATCH 2/2] net: ll_temac: improve reset of buffer on dma mapping Jonas Suhr Christensen
2023-01-28  7:13   ` Jakub Kicinski
2023-01-30 12:40     ` esben
2023-01-30 20:42       ` Jakub Kicinski [this message]
2023-01-28  7:20 ` [PATCH 1/2] net: ll_temac: fix DMA resources leak Jakub Kicinski
2023-01-30 12:30   ` esben
2023-01-30 21:56 ` Christophe JAILLET
2023-01-31  0:20   ` Jakub Kicinski

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=20230130124215.1a06c5af@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=esben@geanix.com \
    --cc=jsc@umbraculum.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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).