i2c: Add missing result check
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
parent
19bc427e44
commit
05753b98c0
|
@ -260,6 +260,10 @@ struct i2c_client *i2c_new_device(struct i2c_adapter *adapter,
|
|||
client->dev.parent = &adapter->dev;
|
||||
|
||||
status = register_device(&client->dev);
|
||||
if (status) {
|
||||
free(client);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if 0
|
||||
/* drivers may modify this initial i/o setup */
|
||||
|
|
Loading…
Reference in New Issue