[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <95ee54a0-a5ff-a9f0-0d87-471e0f1f790c@web.de>
Date: Fri, 27 Sep 2019 16:26:28 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: Navid Emamdoost <navid.emamdoost@...il.com>,
Jakub Kicinski <jakub.kicinski@...ronome.com>,
netdev@...r.kernel.org, oss-drivers@...ronome.com
Cc: Navid Emamdoost <emamd001@....edu>, Kangjie Lu <kjlu@....edu>,
Stephen A McCamant <smccaman@....edu>,
"David S. Miller" <davem@...emloft.net>,
Frederik Lotter <frederik.lotter@...ronome.com>,
John Hurley <john.hurley@...ronome.com>,
Pieter Jansen van Vuuren
<pieter.jansenvanvuuren@...ronome.com>,
Simon Horman <simon.horman@...ronome.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] nfp: flower: prevent memory leak in
nfp_flower_spawn_phy_reprs
> In nfp_flower_spawn_phy_reprs, in the for loop over eth_tbl if any of
> intermediate allocations or initializations fail memory is leaked.
> requiered releases are added.
I suggest to improve also this change description.
> @@ -542,6 +545,7 @@ nfp_flower_spawn_phy_reprs(struct nfp_app *app, struct nfp_flower_priv *priv)
> err = nfp_repr_init(app, repr,
> cmsg_port_id, port, priv->nn->dp.netdev);
> if (err) {
> + kfree(repr_priv);
> nfp_port_free(port);
> nfp_repr_free(repr);
> goto err_reprs_clean;
How do you think about to move common exception handling code
to the end of this function implementation by adding jump targets?
Regards,
Markus
Powered by blists - more mailing lists