mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe
[ Upstream commitd78a167332] Using pcim_enable_device() to avoid missing pci_disable_device(). Fixes:7e94dd154e("i2c-pxa2xx: Add PCI support for PXA I2C controller") Signed-off-by: Hui Tang <tanghui20@huawei.com> Signed-off-by: Wolfram Sang <wsa@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
c46db6088b
commit
46b3885c8c
@@ -105,7 +105,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
|
|||||||
int i;
|
int i;
|
||||||
struct ce4100_devices *sds;
|
struct ce4100_devices *sds;
|
||||||
|
|
||||||
ret = pci_enable_device_mem(dev);
|
ret = pcim_enable_device(dev);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@@ -114,10 +114,8 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
|
|||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
sds = kzalloc(sizeof(*sds), GFP_KERNEL);
|
sds = kzalloc(sizeof(*sds), GFP_KERNEL);
|
||||||
if (!sds) {
|
if (!sds)
|
||||||
ret = -ENOMEM;
|
return -ENOMEM;
|
||||||
goto err_mem;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
|
for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
|
||||||
sds->pdev[i] = add_i2c_device(dev, i);
|
sds->pdev[i] = add_i2c_device(dev, i);
|
||||||
@@ -133,8 +131,6 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
|
|||||||
|
|
||||||
err_dev_add:
|
err_dev_add:
|
||||||
kfree(sds);
|
kfree(sds);
|
||||||
err_mem:
|
|
||||||
pci_disable_device(dev);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user