[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190927144242.7e0d8fde@cakuba.netronome.com>
Date: Fri, 27 Sep 2019 14:42:42 -0700
From: Jakub Kicinski <jakub.kicinski@...ronome.com>
To: Markus Elfring <Markus.Elfring@....de>
Cc: Navid Emamdoost <navid.emamdoost@...il.com>,
netdev@...r.kernel.org, oss-drivers@...ronome.com,
Navid Emamdoost <emamd001@....edu>, Kangjie Lu <kjlu@....edu>,
Stephen A McCamant <smccaman@....edu>,
Colin Ian King <colin.king@...onical.com>,
"David S. Miller" <davem@...emloft.net>,
John Hurley <john.hurley@...ronome.com>,
Pablo Neira <pablo@...filter.org>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH v3] nfp: abm: fix memory leak in
nfp_abm_u32_knode_replace
On Fri, 27 Sep 2019 14:12:42 +0200, Markus Elfring wrote:
> > Updated other gotos to have correct errno returned, too.
>
> How do you think about to add a jump target here?
>
>
> > +++ b/drivers/net/ethernet/netronome/nfp/abm/cls.c
> > @@ -176,8 +176,10 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
> > u8 mask, val;
> > int err;
> >
> > - if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack))
> > + if (!nfp_abm_u32_check_knode(alink->abm, knode, proto, extack)) {
> > + err = -EOPNOTSUPP;
> > goto err_delete;
> > + }
> >
> > tos_off = proto == htons(ETH_P_IP) ? 16 : 20;
>
> - goto err_delete;
> + goto e_opnotsupp;
>
>
> > @@ -221,7 +227,7 @@ nfp_abm_u32_knode_replace(struct nfp_abm_link *alink,
> >
>
> +e_opnotsupp:
> + err = -EOPNOTSUPP;
>
> > err_delete:
> > nfp_abm_u32_knode_delete(alink, knode);
> > - return -EOPNOTSUPP;
> > + return err;
> > }
> >
> > static int nfp_abm_setup_tc_block_cb(enum tc_setup_type type,
>
>
> Can such a change variant be a bit nicer?
Definitely not.
Looks good as is, thanks Navid!
Powered by blists - more mailing lists