Commit 47eaa23b authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller

nfp: fix memory leak on FW load error

Free management FW info when app FW load failed.

Fixes: eefbde7e ("nfp: add hwmon support")
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c66a9cf4
...@@ -279,6 +279,7 @@ static int nfp_nsp_init(struct pci_dev *pdev, struct nfp_pf *pf) ...@@ -279,6 +279,7 @@ static int nfp_nsp_init(struct pci_dev *pdev, struct nfp_pf *pf)
err = nfp_fw_load(pdev, pf, nsp); err = nfp_fw_load(pdev, pf, nsp);
if (err < 0) { if (err < 0) {
kfree(pf->nspi);
kfree(pf->eth_tbl); kfree(pf->eth_tbl);
dev_err(&pdev->dev, "Failed to load FW\n"); dev_err(&pdev->dev, "Failed to load FW\n");
goto exit_close_nsp; goto exit_close_nsp;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment