Commit 7a703ade authored by Axel Lin's avatar Axel Lin Committed by Ben Dooks

i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths

Signed-off-by: default avatarAxel Lin <axel.lin@gmail.com>
Acked-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: default avatarBen Dooks <ben-linux@fluff.org>
parent 9e79e3e9
...@@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev, ...@@ -109,12 +109,15 @@ static int __devinit 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;
goto err_mem; 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);
if (IS_ERR(sds->pdev[i])) { if (IS_ERR(sds->pdev[i])) {
ret = PTR_ERR(sds->pdev[i]);
while (--i >= 0) while (--i >= 0)
platform_device_unregister(sds->pdev[i]); platform_device_unregister(sds->pdev[i]);
goto err_dev_add; goto err_dev_add;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment