Skip to content

Commit 122c577

Browse files
tititiou36gregkh
authored andcommitted
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: 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>
1 parent a0341fc commit 122c577

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

drivers/fpga/altera-cvp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,10 @@ static int altera_cvp_probe(struct pci_dev *pdev,
455455

456456
mgr = fpga_mgr_create(&pdev->dev, conf->mgr_name,
457457
&altera_cvp_ops, conf);
458-
if (!mgr)
459-
return -ENOMEM;
458+
if (!mgr) {
459+
ret = -ENOMEM;
460+
goto err_unmap;
461+
}
460462

461463
pci_set_drvdata(pdev, mgr);
462464

0 commit comments

Comments
 (0)