diff options
| author | saturneric <[email protected]> | 2025-10-16 21:50:56 +0000 |
|---|---|---|
| committer | saturneric <[email protected]> | 2025-10-16 21:50:56 +0000 |
| commit | 5293dcd7ffda472dbf326c81877bb63d2bfcbd10 (patch) | |
| tree | da3be05c4aa1646e5f26a84cd75d83fe866c5358 /drivers/i2c/i2c-core-base.c | |
| parent | Merge tag 'v6.16' (diff) | |
| parent | Linux 6.17 (diff) | |
| download | kernel-5293dcd7ffda472dbf326c81877bb63d2bfcbd10.tar.gz kernel-5293dcd7ffda472dbf326c81877bb63d2bfcbd10.zip | |
Merge tag 'v6.17'
Linux 6.17
Diffstat (limited to 'drivers/i2c/i2c-core-base.c')
| -rw-r--r-- | drivers/i2c/i2c-core-base.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 2ad2b1838f0f..ecca8c006b02 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -573,7 +573,7 @@ static int i2c_device_probe(struct device *dev) goto err_clear_wakeup_irq; do_power_on = !i2c_acpi_waive_d0_probe(dev); - status = dev_pm_domain_attach(&client->dev, do_power_on); + status = dev_pm_domain_attach(&client->dev, do_power_on ? PD_FLAG_ATTACH_POWER_ON : 0); if (status) goto err_clear_wakeup_irq; @@ -1066,7 +1066,13 @@ void i2c_unregister_device(struct i2c_client *client) of_node_clear_flag(to_of_node(fwnode), OF_POPULATED); else if (is_acpi_device_node(fwnode)) acpi_device_clear_enumerated(to_acpi_device_node(fwnode)); - fwnode_handle_put(fwnode); + + /* + * If the primary fwnode is a software node it is free-ed by + * device_remove_software_node() below, avoid double-free. + */ + if (!is_software_node(fwnode)) + fwnode_handle_put(fwnode); device_remove_software_node(&client->dev); device_unregister(&client->dev); |
