linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	Alexandre Belloni <alexandre.belloni@bootlin.com>,
	Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 4/5] net: mscc: ocelot: make entry_type a member of struct ocelot_multicast
Date: Sat, 31 Oct 2020 09:07:52 +0000	[thread overview]
Message-ID: <20201031090751.6olljapbivitzf6k@skbuf> (raw)
In-Reply-To: <20201030181631.20692b43@kicinski-fedora-PC1C0HJN.hsd1.ca.comcast.net>

On Fri, Oct 30, 2020 at 06:16:31PM -0700, Jakub Kicinski wrote:
> On Thu, 29 Oct 2020 04:27:37 +0200 Vladimir Oltean wrote:
> > +		mc = devm_kzalloc(ocelot->dev, sizeof(*mc), GFP_KERNEL);
> > +		if (!mc)
> > +			return -ENOMEM;
> > +
> > +		mc->entry_type = ocelot_classify_mdb(mdb->addr);
> > +		ether_addr_copy(mc->addr, mdb->addr);
> > +		mc->vid = vid;
> > +
> > +		pgid = ocelot_mdb_get_pgid(ocelot, mc);
> >  
> >  		if (pgid < 0) {
> >  			dev_err(ocelot->dev,
> > @@ -1038,24 +1044,19 @@ int ocelot_port_mdb_add(struct ocelot *ocelot, int port,
> >  			return -ENOSPC;
> >  		}
> 
> Transitionally leaking mc here on pgid < 0

Is it a real leakage if it's allocated with devm though? At some point
it's still going to be freed. Nonetheless I agree there's still a lot of
work to do. Maybe I didn't choose the best moment to concentrate on a
new feature, should have focused on cleanup more beforehand, including a
change from devm to plain allocation/free of resources.

  reply	other threads:[~2020-10-31  9:08 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-29  2:27 [PATCH net-next 0/5] L2 multicast forwarding for Ocelot switch Vladimir Oltean
2020-10-29  2:27 ` [PATCH net-next 1/5] net: mscc: ocelot: classify L2 mdb entries as LOCKED Vladimir Oltean
2020-10-29  2:31   ` Florian Fainelli
2020-10-29  2:27 ` [PATCH net-next 2/5] net: mscc: ocelot: use ether_addr_copy Vladimir Oltean
2020-10-29  2:32   ` Florian Fainelli
2020-10-29  2:27 ` [PATCH net-next 3/5] net: mscc: ocelot: remove the "new" variable in ocelot_port_mdb_add Vladimir Oltean
2020-10-29  2:32   ` Florian Fainelli
2020-10-29  2:27 ` [PATCH net-next 4/5] net: mscc: ocelot: make entry_type a member of struct ocelot_multicast Vladimir Oltean
2020-10-29  2:37   ` Florian Fainelli
2020-10-29 11:06     ` Vladimir Oltean
2020-10-31  1:16   ` Jakub Kicinski
2020-10-31  9:07     ` Vladimir Oltean [this message]
2020-10-29  2:27 ` [PATCH net-next 5/5] net: mscc: ocelot: support L2 multicast entries Vladimir Oltean
2020-10-29  2:41   ` Florian Fainelli
2020-10-31  1:27 ` [PATCH net-next 0/5] L2 multicast forwarding for Ocelot switch 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=20201031090751.6olljapbivitzf6k@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=vivien.didelot@gmail.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).