Skip to contentSkip to conversation

of: overlay: fix warning being reported as error in add_changeset_property

PATCH In review Ankit 16. Kumar (Nokia) 2 participants 4 messages Dec 30, 2022 – Jan 10, 2023 1 message not in the archive Device tree

lore
Share & tools
lore
#1 lore raw

PATCH 1/1 of: overlay: fix warning being reported as error in add_changeset_property

In reply to a message not in the archive

The print causes false reporting of the issue which actually is a warning

Fixes 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
---
 drivers/of/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/overlay.c +2 -1
@@ -358,7 +358,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
 	}
 
 	if (!of_node_check_flag(target->np, OF_OVERLAY))
-		pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n",
+		pr_warn("WARNING: memory leak will occur if overlay removed, 
+property: %pOF/%s\n",
 		       target->np, new_prop->name);
 

if (ret) {
--
2.30.1

#2 lore raw
Quoted 2 lines · On 12/30/22 02:40, Ankit 16. Kumar (Nokia) wrote:

The print causes false reporting of the issue which actually is a warning

How did you select the commit in this Fixes tag?

Quoted 21 lines
Fixes 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
---
 drivers/of/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/overlay.c +2 -2
@@ -358,7 +358,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
 	}
 
 	if (!of_node_check_flag(target->np, OF_OVERLAY))
-		pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n",
+		pr_warn("WARNING: memory leak will occur if overlay removed, 
+property: %pOF/%s\n",
 		       target->np, new_prop->name);
 
 	if (ret) {
--
Quoted 2 lines

2.30.1

NACK. This patch is incorrect. The reported memory leak is a bug, not a warning.

I'll write up some information about why the memory leak occurs, then reply to this email with the additional info.

-Frank

#3 lore raw
Quoted 32 lines · Frank Rowand
Quoted 2 lines · On 12/30/22 02:40, Ankit 16. Kumar (Nokia) wrote:

The print causes false reporting of the issue which actually is a warning

How did you select the commit in this Fixes tag?

Quoted 21 lines
Fixes 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
---
 drivers/of/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/overlay.c +2 -2
@@ -358,7 +358,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
 	}
 
 	if (!of_node_check_flag(target->np, OF_OVERLAY))
-		pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n",
+		pr_warn("WARNING: memory leak will occur if overlay removed, 
+property: %pOF/%s\n",
 		       target->np, new_prop->name);
 
 	if (ret) {
--
Quoted 2 lines

2.30.1

NACK. This patch is incorrect. The reported memory leak is a bug, not a warning.

Quoted 2 lines

I'll write up some information about why the memory leak occurs, then reply to this email with the additional info.

The additional information is now available at:

https://elinux.org/Device_Tree_Linux#Object_Lifetime

Quoted 2 lines

-Frank

#4 lore raw
Quoted 33 lines · Frank Rowand
Quoted 32 lines · Frank Rowand
Quoted 2 lines · On 12/30/22 02:40, Ankit 16. Kumar (Nokia) wrote:

The print causes false reporting of the issue which actually is a warning

How did you select the commit in this Fixes tag?

Quoted 21 lines
Fixes 2fe0e8769df9 ("of: overlay: check prevents multiple fragments touching same property")
---
 drivers/of/overlay.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/overlay.c +2 -2
@@ -358,7 +358,7 @@ static int add_changeset_property(struct overlay_changeset *ovcs,
 	}
 
 	if (!of_node_check_flag(target->np, OF_OVERLAY))
-		pr_err("WARNING: memory leak will occur if overlay removed, property: %pOF/%s\n",
+		pr_warn("WARNING: memory leak will occur if overlay removed, 
+property: %pOF/%s\n",
 		       target->np, new_prop->name);
 
 	if (ret) {
--
Quoted 2 lines

2.30.1

NACK. This patch is incorrect. The reported memory leak is a bug, not a warning.

Quoted 6 lines
Quoted 2 lines

I'll write up some information about why the memory leak occurs, then reply to this email with the additional info.

The additional information is now available at:

https://elinux.org/Device_Tree_Linux#Object_Lifetime

I have now expanded the information at that link to content that is beyond the original topic. Those interested in devicetree memory object may find the additional info useful.

Quoted 4 lines
Quoted 3 lines

-Frank