Reference count of device node was increased in of_i2c_register_device,
but without decreasing it in i2c_unregister_device. Then the dynamically
added device node will never be released.
Fix this by adding the of_node_put.
Signed-off-by: Lixin Wang
---
drivers/i2c/i2c-core-base.c | 4 +++-
1
off-by: Lixin Wang
---
v4 -> v5:
* fix the bug in v4, that the prop->next should be saved before release
the prop.
drivers/of/dynamic.c | 26 ++
1 file changed, 14 insertions(+), 12 deletions(-)
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 301b
off-by: Lixin Wang
Reviewed-by: Frank Rowand
---
Thanks the idea from Rob Herring, that I forgot to mention at patch v3.
Thanks Frank Rowand for writing to me the example.
v3 -> v4:
* Using the style that is more consistent with device tree
code, as suggested by Frank Rowand
drivers/of/
off-by: Lixin Wang
---
v2 -> v3:
* Add a separate function to release the properties in both lists.
* Change the patch description for this change.
drivers/of/dynamic.c | 27 +++
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/drivers/of/dynamic.c b/d
If a node with no properties is dynamically added, then a property is
dynamically added to the node, then the property is dynamically removed,
the result will be node->properties == NULL and node->deadprops != NULL.
Signed-off-by: Lixin Wang
---
v1:
* Change the description of this pa
From: alawang
Function of_changeset_add_property or of_changeset_update_property may
fails. In this case the property just allocated is never deallocated.
Signed-off-by: Lixin Wang
---
drivers/of/overlay.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a
, all properties of which had been moved to
deadprops.
In this case, the properties in the deadprops list are never
deallocated.
Signed-off-by: Lixin Wang
---
drivers/of/dynamic.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/of/dynamic.c b/drivers/of/dynamic.c
index 301b6db
: Lixin Wang
---
drivers/of/overlay.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index 8ecfee3..af3b9a1 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -162,6 +162,7 @@ static int
8 matches
Mail list logo