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: 7085e2a94f ("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
a0341fc198
commit
122c5770cf
@@ -455,8 +455,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,
|
|||||||
|
|
||||||
mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name,
|
mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name,
|
||||||
&altera_cvp_ops, conf);
|
&altera_cvp_ops, conf);
|
||||||
if (!mgr)
|
if (!mgr) {
|
||||||
return -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
goto err_unmap;
|
||||||
|
}
|
||||||
|
|
||||||
pci_set_drvdata(pdev, mgr);
|
pci_set_drvdata(pdev, mgr);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user