Skip to content

Commit 6558b64

Browse files
jamieileswsakernel
authored andcommitted
i2c: acpi: fix resource leak in reconfiguration device addition
acpi_i2c_find_adapter_by_handle() calls bus_find_device() which takes a reference on the adapter which is never released which will result in a reference count leak and render the adapter unremovable. Make sure to put the adapter after creating the client in the same manner that we do for OF. Fixes: 525e6fa ("i2c / ACPI: add support for ACPI reconfigure notifications") Signed-off-by: Jamie Iles <[email protected]> Acked-by: Mika Westerberg <[email protected]> [wsa: fixed title] Signed-off-by: Wolfram Sang <[email protected]>
1 parent 5816b3e commit 6558b64

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/i2c/i2c-core-acpi.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ static int i2c_acpi_notify(struct notifier_block *nb, unsigned long value,
454454
break;
455455

456456
i2c_acpi_register_device(adapter, adev, &info);
457+
put_device(&adapter->dev);
457458
break;
458459
case ACPI_RECONFIG_DEVICE_REMOVE:
459460
if (!acpi_device_enumerated(adev))

0 commit comments

Comments
 (0)