Skip to content

Commit

Permalink
fpga: altera-cvp: Fix an error handling path in 'altera_cvp_probe()'
Browse files Browse the repository at this point in the history
If 'fpga_mgr_create()' fails, we should release some resources, as done
in the other error handling path of the function.

Fixes: 7085e2a ("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>
  • Loading branch information
Christophe Jaillet authored and Greg Kroah-Hartman committed Jul 7, 2018
1 parent a0341fc commit 122c577
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/fpga/altera-cvp.c
Original file line number Diff line number Diff line change
Expand Up @@ -455,8 +455,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,

mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name,
&altera_cvp_ops, conf);
if (!mgr)
return -ENOMEM;
if (!mgr) {
ret = -ENOMEM;
goto err_unmap;
}

pci_set_drvdata(pdev, mgr);

Expand Down

0 comments on commit 122c577

Please sign in to comment.