netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: alexious@zju.edu.cn
To: "Suman Ghosh" <sumang@marvell.com>
Cc: "Jakub Kicinski" <kuba@kernel.org>,
	 "Chris Snook" <chris.snook@gmail.com>,
	 "David S. Miller" <davem@davemloft.net>,
	 "Eric Dumazet" <edumazet@google.com>,
	 "Paolo Abeni" <pabeni@redhat.com>,
	"Simon Horman" <horms@kernel.org>,
	 "Yuanjun Gong" <ruc_gongyuanjun@163.com>,
	 "Jie Yang" <jie.yang@atheros.com>,
	 "Jeff Garzik" <jgarzik@redhat.com>,
	 "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	 "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: RE: [EXT] [PATCH] ethernet: atheros: fix a memleak in atl1e_setup_ring_resources
Date: Fri, 8 Dec 2023 16:12:59 +0800 (GMT+08:00)	[thread overview]
Message-ID: <54c0af4f.28cff.18c487cab21.Coremail.alexious@zju.edu.cn> (raw)
In-Reply-To: <SJ0PR18MB5216F502703DA2B49B013BC7DB8BA@SJ0PR18MB5216.namprd18.prod.outlook.com>

> >On Thu, 7 Dec 2023 17:08:15 +0000 Suman Ghosh wrote:
> >> >+		kfree(tx_ring->tx_buffer);
> >>
> >> [Suman] I think we should do tx_ring->tx_buffer = NULL also, to avoid
> >use after free?
> >
> >It's up to the driver. Some may call that defensive programming.
> [Suman] Agree. I pointed it out since this driver is using this approach at other places. But sure, it is up to Zhipeng.

[Zhipeng] I think Suman's suggestion is valuable, it prevents potiential use-after-free and is consistent with other free operations in the same module.

      reply	other threads:[~2023-12-08  8:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-07 14:38 [PATCH] ethernet: atheros: fix a memleak in atl1e_setup_ring_resources Zhipeng Lu
2023-12-07 17:08 ` [EXT] " Suman Ghosh
2023-12-07 17:42   ` Jakub Kicinski
2023-12-07 17:54     ` Suman Ghosh
2023-12-08  8:12       ` alexious [this message]

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=54c0af4f.28cff.18c487cab21.Coremail.alexious@zju.edu.cn \
    --to=alexious@zju.edu.cn \
    --cc=chris.snook@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jgarzik@redhat.com \
    --cc=jie.yang@atheros.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=ruc_gongyuanjun@163.com \
    --cc=sumang@marvell.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).