diff options
author | Chen Ridong <chenridong@huawei.com> | 2024-08-26 05:43:39 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2024-09-06 17:59:37 +0300 |
commit | d43b24f50da293009050e172e7c3769571db79c6 (patch) | |
tree | e94890b12f8fd89e81e08678de7616673c571928 /drivers/mtd/nand | |
parent | ccce71013406a0a3c81850dab940f07b112349d3 (diff) | |
download | linux-d43b24f50da293009050e172e7c3769571db79c6.tar.xz |
mtd: rawnand: denali: Fix missing pci_release_regions in probe and remove
The pci_release_regions was miss at error case, just add it.
Signed-off-by: Chen Ridong <chenridong@huawei.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20240826024339.476921-1-chenridong@huawei.com
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r-- | drivers/mtd/nand/raw/denali_pci.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/raw/denali_pci.c b/drivers/mtd/nand/raw/denali_pci.c index de7e722d3826..e22094e39546 100644 --- a/drivers/mtd/nand/raw/denali_pci.c +++ b/drivers/mtd/nand/raw/denali_pci.c @@ -77,18 +77,20 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) denali->reg = devm_ioremap(denali->dev, csr_base, csr_len); if (!denali->reg) { dev_err(&dev->dev, "Spectra: Unable to remap memory region\n"); - return -ENOMEM; + ret = -ENOMEM; + goto regions_release; } denali->host = devm_ioremap(denali->dev, mem_base, mem_len); if (!denali->host) { dev_err(&dev->dev, "Spectra: ioremap failed!"); - return -ENOMEM; + ret = -ENOMEM; + goto regions_release; } ret = denali_init(denali); if (ret) - return ret; + goto regions_release; nsels = denali->nbanks; @@ -116,6 +118,8 @@ static int denali_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) out_remove_denali: denali_remove(denali); +regions_release: + pci_release_regions(dev); return ret; } @@ -123,6 +127,7 @@ static void denali_pci_remove(struct pci_dev *dev) { struct denali_controller *denali = pci_get_drvdata(dev); + pci_release_regions(dev); denali_remove(denali); } |