Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c226717a authored by Hui Tang's avatar Hui Tang Committed by Greg Kroah-Hartman
Browse files

i2c: pxa-pci: fix missing pci_disable_device() on error in ce4100_i2c_probe



[ Upstream commit d78a167332e1ca8113268ed922c1212fd71b73ad ]

Using pcim_enable_device() to avoid missing pci_disable_device().

Fixes: 7e94dd15 ("i2c-pxa2xx: Add PCI support for PXA I2C controller")
Signed-off-by: default avatarHui Tang <tanghui20@huawei.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent d85b5247
Loading
Loading
Loading
Loading
+3 −7
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
	int i;
	struct ce4100_devices *sds;

	ret = pci_enable_device_mem(dev);
	ret = pcim_enable_device(dev);
	if (ret)
		return ret;

@@ -114,10 +114,8 @@ static int ce4100_i2c_probe(struct pci_dev *dev,
		return -EINVAL;
	}
	sds = kzalloc(sizeof(*sds), GFP_KERNEL);
	if (!sds) {
		ret = -ENOMEM;
		goto err_mem;
	}
	if (!sds)
		return -ENOMEM;

	for (i = 0; i < ARRAY_SIZE(sds->pdev); 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:
	kfree(sds);
err_mem:
	pci_disable_device(dev);
	return ret;
}