diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2018-06-27 21:56:18 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-07-07 10:55:22 -0400 |
commit | 122c5770cff2c1df1a2384b68285be2812cd72c1 (patch) | |
tree | 817c78722f8b85c440a7661dcbdb17e85409fd40 /drivers/fpga | |
parent | a0341fc1981a950c1e902ab901e98f60e0e243f3 (diff) |
fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()'
If 'fpga_mgr_create()' fails, we should release some resources, as done
in the other error handling path of the function.
Fixes: 7085e2a94f7d ("fpga: manager: change api, don't use drvdata")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Moritz Fischer <mdf@kernel.org>
Acked-by: Alan Tull <atull@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/fpga')
-rw-r--r-- | drivers/fpga/altera-cvp.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c index dd4edd8f22ce..7fa793672a7a 100644 --- a/drivers/fpga/altera-cvp.c +++ b/drivers/fpga/altera-cvp.c | |||
@@ -455,8 +455,10 @@ static int altera_cvp_probe(struct pci_dev *pdev, | |||
455 | 455 | ||
456 | mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name, | 456 | mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name, |
457 | &altera_cvp_ops, conf); | 457 | &altera_cvp_ops, conf); |
458 | if (!mgr) | 458 | if (!mgr) { |
459 | return -ENOMEM; | 459 | ret = -ENOMEM; |
460 | goto err_unmap; | ||
461 | } | ||
460 | 462 | ||
461 | pci_set_drvdata(pdev, mgr); | 463 | pci_set_drvdata(pdev, mgr); |
462 | 464 | ||