Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 101286
b: refs/heads/master
c: 6ea438e
h: refs/heads/master
v: v3
  • Loading branch information
David Brownell authored and Jean Delvare committed Jul 14, 2008
1 parent 53e87e3 commit f1a3fce
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a1cdedac634eef81f747078bf1c27ad36ab13553
refs/heads/master: 6ea438ec8da4ec56bf415f5ea360e6b0cb59c6c3
8 changes: 5 additions & 3 deletions trunk/drivers/i2c/i2c-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -866,8 +866,9 @@ EXPORT_SYMBOL(i2c_detach_client);
*/
struct i2c_client *i2c_use_client(struct i2c_client *client)
{
get_device(&client->dev);
return client;
if (client && get_device(&client->dev))
return client;
return NULL;
}
EXPORT_SYMBOL(i2c_use_client);

Expand All @@ -879,7 +880,8 @@ EXPORT_SYMBOL(i2c_use_client);
*/
void i2c_release_client(struct i2c_client *client)
{
put_device(&client->dev);
if (client)
put_device(&client->dev);
}
EXPORT_SYMBOL(i2c_release_client);

Expand Down

0 comments on commit f1a3fce

Please sign in to comment.