Commit c0b86d26 authored by Lixin Wang's avatar Lixin Wang Committed by Greg Kroah-Hartman

i2c: core: decrease reference count of device node in i2c_unregister_device

commit e0638fa4 upstream.

Reference count of device node was increased in of_i2c_register_device,
but without decreasing it in i2c_unregister_device. Then the added
device node will never be released. Fix this by adding the of_node_put.
Signed-off-by: default avatarLixin Wang <>
Tested-by: default avatarWolfram Sang <>
Signed-off-by: default avatarWolfram Sang <>
Signed-off-by: default avatarSudip Mukherjee <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 2d5fc7ff
......@@ -808,8 +808,11 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
void i2c_unregister_device(struct i2c_client *client)
if (client->dev.of_node)
if (client->dev.of_node) {
of_node_clear_flag(client->dev.of_node, OF_POPULATED);
if (ACPI_COMPANION(&client->dev))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment