lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Sep 2022 13:37:46 +0000
From:   Ioana Ciornei <ioana.ciornei@....com>
To:     Paolo Abeni <pabeni@...hat.com>
CC:     "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        Robert-Ionut Alexa <robert-ionut.alexa@....com>
Subject: Re: [PATCH net-next v2 03/12] net: dpaa2-eth: add support for
 multiple buffer pools per DPNI

On Tue, Sep 27, 2022 at 02:47:37PM +0200, Paolo Abeni wrote:
> On Fri, 2022-09-23 at 18:45 +0300, Ioana Ciornei wrote:
> > From: Robert-Ionut Alexa <robert-ionut.alexa@....com>
> > 
> > This patch allows the configuration of multiple buffer pools associated
> > with a single DPNI object, each distinct DPBP object not necessarily
> > shared among all queues.
> > The user can interogate both the number of buffer pools and the buffer
> > count in each buffer pool by using the .get_ethtool_stats() callback.
> > 
> > Signed-off-by: Robert-Ionut Alexa <robert-ionut.alexa@....com>
> > Signed-off-by: Ioana Ciornei <ioana.ciornei@....com>
> > ---
> > Changes in v2:
> >  - Export dpaa2_eth_allocate_dpbp/dpaa2_eth_free_dpbp in this patch to
> >    avoid a build warning. The functions will be used in next patches.
> > 

(...)

> > -/* Allocate and configure one buffer pool for each interface */
> > -static int dpaa2_eth_setup_dpbp(struct dpaa2_eth_priv *priv)
> > +/* Allocate and configure a buffer pool */
> > +struct dpaa2_eth_bp *dpaa2_eth_allocate_dpbp(struct dpaa2_eth_priv *priv)
> >  {
> > -	int err;
> > -	struct fsl_mc_device *dpbp_dev;
> >  	struct device *dev = priv->net_dev->dev.parent;
> > +	struct fsl_mc_device *dpbp_dev;
> >  	struct dpbp_attr dpbp_attrs;
> > +	struct dpaa2_eth_bp *bp;
> > +	int err;
> >  
> >  	err = fsl_mc_object_allocate(to_fsl_mc_device(dev), FSL_MC_POOL_DPBP,
> >  				     &dpbp_dev);
> > @@ -3219,12 +3244,16 @@ static int dpaa2_eth_setup_dpbp(struct dpaa2_eth_priv *priv)
> >  			err = -EPROBE_DEFER;
> >  		else
> >  			dev_err(dev, "DPBP device allocation failed\n");
> > -		return err;
> > +		return ERR_PTR(err);
> >  	}
> >  
> > -	priv->dpbp_dev = dpbp_dev;
> > +	bp = kzalloc(sizeof(*bp), GFP_KERNEL);
> > +	if (!bp) {
> > +		err = -ENOMEM;
> > +		goto err_alloc;
> > +	}
> 
> It looks like 'bp' is leaked on later error paths.
> 

Yes, I missed this.

Thanks!

Powered by blists - more mailing lists