Skip to content

Commit

Permalink
i2c-pxa2xx: return proper error code in ce4100_i2c_probe error paths
Browse files Browse the repository at this point in the history
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Axel Lin authored and Ben Dooks committed Sep 6, 2011
1 parent 9e79e3e commit 7a703ad
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion drivers/i2c/busses/i2c-pxa-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,15 @@ static int __devinit ce4100_i2c_probe(struct pci_dev *dev,
return -EINVAL;
}
sds = kzalloc(sizeof(*sds), GFP_KERNEL);
if (!sds)
if (!sds) {
ret = -ENOMEM;
goto err_mem;
}

for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) {
sds->pdev[i] = add_i2c_device(dev, i);
if (IS_ERR(sds->pdev[i])) {
ret = PTR_ERR(sds->pdev[i]);
while (--i >= 0)
platform_device_unregister(sds->pdev[i]);
goto err_dev_add;
Expand Down

0 comments on commit 7a703ad

Please sign in to comment.