mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 12:21:22 -05:00
mfd: ls2kbmc: check for devm_mfd_add_devices() failure
Call pci_disable_device() if devm_mfd_add_devices() fails.
Fixes: 0d64f6d1ff ("mfd: ls2kbmc: Introduce Loongson-2K BMC core driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <e3e7cf2cfded48c9fca8bc981c54bbcb7edb9580.1759478975.git.dan.carpenter@linaro.org>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
committed by
Corey Minyard
parent
0892507f4a
commit
4af66c2bca
@@ -495,9 +495,13 @@ static int ls2k_bmc_probe(struct pci_dev *dev, const struct pci_device_id *id)
|
||||
goto disable_pci;
|
||||
}
|
||||
|
||||
return devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
|
||||
ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells),
|
||||
&dev->resource[0], 0, NULL);
|
||||
ret = devm_mfd_add_devices(&dev->dev, PLATFORM_DEVID_AUTO,
|
||||
ls2k_bmc_cells, ARRAY_SIZE(ls2k_bmc_cells),
|
||||
&dev->resource[0], 0, NULL);
|
||||
if (ret)
|
||||
goto disable_pci;
|
||||
|
||||
return 0;
|
||||
|
||||
disable_pci:
|
||||
pci_disable_device(dev);
|
||||
|
||||
Reference in New Issue
Block a user