From: esben@geanix.com
To: Jakub Kicinski <kuba@kernel.org>
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 13:40:56 +0100 [thread overview]
Message-ID: <87edrc8aav.fsf@geanix.com> (raw)
In-Reply-To: <20230127231322.08b75b36@kernel.org> (Jakub Kicinski's message of "Fri, 27 Jan 2023 23:13:22 -0800")
Jakub Kicinski <kuba@kernel.org> writes:
> 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.
Can we be sure that doing so is always safe? If not, this change
ensures that we only unmap buffers that were succesfully mapped.
/Esben
next prev parent reply other threads:[~2023-01-30 12:41 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 [this message]
2023-01-30 20:42 ` Jakub Kicinski
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=87edrc8aav.fsf@geanix.com \
--to=esben@geanix.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=jsc@umbraculum.org \
--cc=kuba@kernel.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).