Skip to content

Commit

Permalink
ionic: fix missing pci_release_regions() on error in ionic_probe()
Browse files Browse the repository at this point in the history
[ Upstream commit e4b1045 ]

If ionic_map_bars() fails, pci_release_regions() need be called.

Fixes: fbfb803 ("ionic: Add hardware init and device commands")
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220506034040.2614129-1-yangyingliang@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Yang Yingliang authored and gregkh committed May 18, 2022
1 parent 2cb8689 commit 8b1b8fc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

err = ionic_map_bars(ionic);
if (err)
goto err_out_pci_disable_device;
goto err_out_pci_release_regions;

/* Configure the device */
err = ionic_setup(ionic);
Expand Down Expand Up @@ -353,6 +353,7 @@ static int ionic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

err_out_unmap_bars:
ionic_unmap_bars(ionic);
err_out_pci_release_regions:
pci_release_regions(pdev);
err_out_pci_disable_device:
pci_disable_device(pdev);
Expand Down

0 comments on commit 8b1b8fc

Please sign in to comment.