Re: [PATCH] nfp: flower: fix memory leak in nfp_flower_spawn_vnic_reprs

From: Markus Elfring
Date: Fri Sep 27 2019 - 10:06:57 EST


> @@ -433,6 +435,7 @@ nfp_flower_spawn_vnic_reprs(struct nfp_app *app,
> err = nfp_repr_init(app, repr,
> 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 using another jump target?

Regards,
Markus