summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core-base.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2019-08-19 23:48:25 +0300
committerWolfram Sang <wsa@the-dreams.de>2019-08-29 21:38:11 +0300
commit689f535843ac2633b395cfc494446326d03efab6 (patch)
tree03f951a3784d58a0333a48f998c4a0539558b1b9 /drivers/i2c/i2c-core-base.c
parenta55aa89aab90fae7c815b0551b07be37db359d76 (diff)
downloadlinux-689f535843ac2633b395cfc494446326d03efab6.tar.xz
i2c: make i2c_unregister_device() ERR_PTR safe
We are moving towards returning ERR_PTRs when i2c_new_*_device() calls fail. Make sure its counterpart for unregistering handles ERR_PTRs as well. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
-rw-r--r--drivers/i2c/i2c-core-base.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c
index f26ed495d384..9c440fa6a3dd 100644
--- a/drivers/i2c/i2c-core-base.c
+++ b/drivers/i2c/i2c-core-base.c
@@ -832,7 +832,7 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
*/
void i2c_unregister_device(struct i2c_client *client)
{
- if (!client)
+ if (IS_ERR_OR_NULL(client))
return;
if (client->dev.of_node) {