From: Dan Carpenter Date: Tue, 29 Aug 2017 19:15:16 +0000 (+0300) Subject: nfp: double free on error in probe X-Git-Tag: MMI-PSA29.97-13-9~4879^2~11 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=e7562597b46d099a78d45c781ee8d1a7a93c53f1;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git nfp: double free on error in probe Both the nfp_net_pf_app_start() and the nfp_net_pci_probe() functions call nfp_net_pf_app_stop_ctrl(pf) so there is a double free. The free should be done from the probe function because it's allocated there so I have removed the call from nfp_net_pf_app_start(). Fixes: 02082701b974 ("nfp: create control vNICs and wire up rx/tx") Signed-off-by: Dan Carpenter Acked-by: Jakub Kicinski Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c index 1aca4e57bf41..34b985384d26 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_main.c @@ -458,7 +458,7 @@ static int nfp_net_pf_app_start(struct nfp_pf *pf) err = nfp_app_start(pf->app, pf->ctrl_vnic); if (err) - goto err_ctrl_stop; + return err; if (pf->num_vfs) { err = nfp_app_sriov_enable(pf->app, pf->num_vfs); @@ -470,8 +470,6 @@ static int nfp_net_pf_app_start(struct nfp_pf *pf) err_app_stop: nfp_app_stop(pf->app); -err_ctrl_stop: - nfp_net_pf_app_stop_ctrl(pf); return err; }