mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: 990492108@qq.com, Abdun Nihaal <abdun.nihaal@gmail.com>,
	netdev@vger.kernel.org
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Bharat Bhushan <bbhushan2@marvell.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Geethasowjanya Akula <gakula@marvell.com>,
	Hariprasad Kelam <hkelam@marvell.com>,
	Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	Subbaraya Sundeep Bhatta <sbhatta@marvell.com>,
	Sunil Goutham <sgoutham@marvell.com>
Subject: Re: [Patch next] octeontx2-pf: fix potential double free in rvu_rep_create()
Date: Tue, 15 Apr 2025 09:32:07 +0200	[thread overview]
Message-ID: <777db8bb-89d2-46ac-b7b9-0b5f418cc716@web.de> (raw)
In-Reply-To: <tzi64aergg2ibm622mk54mavjs6vbpdpfeazdbqoyuufa5ispj@wbygyurrsto5>

…
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
…
> > @@ -691,7 +690,6 @@ int rvu_rep_create(struct otx2_nic *priv, struct netlink_ext_ack *extack)
> >  			NL_SET_ERR_MSG_MOD(extack,
> >  					   "PFVF representor registration failed");
> >  			rvu_rep_devlink_port_unregister(rep);
> > -			free_netdev(ndev);
> >  			goto exit;
> >  		}
>
> There is no potential double free here. If you notice the loop at the
…
> (De)allocations in loops are quite tricky.
>
> Nacked-by: Abdun Nihaal <abdun.nihaal@gmail.com>

Would you ever become interested to avoid a duplicate free_netdev(ndev) call
by using an additional label instead?

See also:
[PATCH net v2 1/2] octeontx2-pf: fix netdev memory leak in rvu_rep_create()
https://lore.kernel.org/netdev/8d54b21b-7ca9-4126-ba13-bbd333d6ba0c@web.de/

Regards,
Markus

  reply	other threads:[~2025-04-15  7:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-13  6:16 cxxz16
2025-04-15  6:03 ` Abdun Nihaal
2025-04-15  7:32   ` Markus Elfring [this message]
2025-04-15 13:44     ` Abdun Nihaal
2025-04-15  6:55 ` [Patch] " Markus Elfring

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=777db8bb-89d2-46ac-b7b9-0b5f418cc716@web.de \
    --to=markus.elfring@web.de \
    --cc=990492108@qq.com \
    --cc=abdun.nihaal@gmail.com \
    --cc=andrew+netdev@lunn.ch \
    --cc=bbhushan2@marvell.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gakula@marvell.com \
    --cc=harshit.m.mogalapalli@oracle.com \
    --cc=hkelam@marvell.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sbhatta@marvell.com \
    --cc=sgoutham@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

all inboxes | Powered by JetHome®