summaryrefslogtreecommitdiff
path: root/drivers/i2c/i2c-core-acpi.c
diff options
context:
space:
mode:
authorWolfram Sang <wsa@the-dreams.de>2020-03-26 14:09:58 +0300
committerWolfram Sang <wsa@the-dreams.de>2020-03-26 14:09:58 +0300
commit6d7e0a34206d4a5d0c619c0608eae57f4c557064 (patch)
tree8024562a9ba37065989414731f5132b3dcc67012 /drivers/i2c/i2c-core-acpi.c
parent90224e6468e15d5eb22a10ae1849cf8ca2e7360a (diff)
parent16fbf79b0f83bc752cee8589279f1ebfe57b3b6e (diff)
downloadlinux-6d7e0a34206d4a5d0c619c0608eae57f4c557064.tar.xz
Merge tag 'v5.6-rc7' into i2c/for-5.7
Linux 5.6-rc7
Diffstat (limited to 'drivers/i2c/i2c-core-acpi.c')
-rw-r--r--drivers/i2c/i2c-core-acpi.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c
index 7665685e3ca8..c8f42f2037cb 100644
--- a/drivers/i2c/i2c-core-acpi.c
+++ b/drivers/i2c/i2c-core-acpi.c
@@ -394,9 +394,17 @@ EXPORT_SYMBOL_GPL(i2c_acpi_find_adapter_by_handle);
static struct i2c_client *i2c_acpi_find_client_by_adev(struct acpi_device *adev)
{
struct device *dev;
+ struct i2c_client *client;
dev = bus_find_device_by_acpi_dev(&i2c_bus_type, adev);
- return dev ? i2c_verify_client(dev) : NULL;
+ if (!dev)
+ return NULL;
+
+ client = i2c_verify_client(dev);
+ if (!client)
+ put_device(dev);
+
+ return client;
}
static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,