Skip to content

Commit

Permalink
i2c: powermac: fix return path on error
Browse files Browse the repository at this point in the history
We want to bail out immediately if i2c_add_adapter failed and not try to
register child nodes with a nilled adapter structure.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
  • Loading branch information
Wolfram Sang committed Aug 21, 2013
1 parent 42fa278 commit 874e955
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/i2c/busses/i2c-powermac.c
Original file line number Diff line number Diff line change
Expand Up @@ -446,6 +446,7 @@ static int i2c_powermac_probe(struct platform_device *dev)
printk(KERN_ERR "i2c-powermac: Adapter %s registration "
"failed\n", adapter->name);
memset(adapter, 0, sizeof(*adapter));
return rc;
}

printk(KERN_INFO "PowerMac i2c bus %s registered\n", adapter->name);
Expand All @@ -455,7 +456,7 @@ static int i2c_powermac_probe(struct platform_device *dev)
*/
i2c_powermac_register_devices(adapter, bus);

return rc;
return 0;
}

static struct platform_driver i2c_powermac_driver = {
Expand Down

0 comments on commit 874e955

Please sign in to comment.