nfp: flower: prevent memory leak in nfp_flower_spawn_phy_reprs
authorNavid Emamdoost <navid.emamdoost@gmail.com>
Wed, 25 Sep 2019 18:24:02 +0000 (13:24 -0500)
committerDavid S. Miller <davem@davemloft.net>
Fri, 27 Sep 2019 18:10:52 +0000 (20:10 +0200)
commit8572cea1461a006bce1d06c0c4b0575869125fa4
tree2474340d64175ca072193f1d2c98e87fb8f9ff3e
parentdfe5999dc03e321d08190772c98843284d5cf419
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.

Fixes: b94524529741 ("nfp: flower: add per repr private data for LAG offload")
Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com>
Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/netronome/nfp/flower/main.c