* [PATCH] of: overlay: fix for_each_child.cocci warnings
@ 2021-03-22 18:21 Julia Lawall
2021-03-22 22:02 ` Frank Rowand
2021-03-24 20:00 ` Rob Herring
0 siblings, 2 replies; 3+ messages in thread
From: Julia Lawall @ 2021-03-22 18:21 UTC (permalink / raw)
To: Pantelis Antoniou, Frank Rowand, Rob Herring
Cc: devicetree, linux-kernel, Sumera Priyadarsini, linux-kernel, kbuild-all
From: kernel test robot <lkp@intel.com>
Function "for_each_child_of_node" should have of_node_put() before goto.
Generated by: scripts/coccinelle/iterators/for_each_child.cocci
Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script")
CC: Sumera Priyadarsini <sylphrenadin@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 812da4d39463a060738008a46cfc9f775e4bfcf6
commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script
:::::: branch date: 13 hours ago
:::::: commit date: 5 months ago
overlay.c | 1 +
1 file changed, 1 insertion(+)
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -796,6 +796,7 @@ static int init_overlay_changeset(struct
if (!fragment->target) {
of_node_put(fragment->overlay);
ret = -EINVAL;
+ of_node_put(node);
goto err_free_fragments;
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: overlay: fix for_each_child.cocci warnings
2021-03-22 18:21 [PATCH] of: overlay: fix for_each_child.cocci warnings Julia Lawall
@ 2021-03-22 22:02 ` Frank Rowand
2021-03-24 20:00 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Frank Rowand @ 2021-03-22 22:02 UTC (permalink / raw)
To: Julia Lawall, Pantelis Antoniou, Rob Herring
Cc: devicetree, linux-kernel, Sumera Priyadarsini, kbuild-all
On 3/22/21 1:21 PM, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
>
> Function "for_each_child_of_node" should have of_node_put() before goto.
>
> Generated by: scripts/coccinelle/iterators/for_each_child.cocci
>
> Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script")
> CC: Sumera Priyadarsini <sylphrenadin@gmail.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 812da4d39463a060738008a46cfc9f775e4bfcf6
> commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script
> :::::: branch date: 13 hours ago
> :::::: commit date: 5 months ago
>
> overlay.c | 1 +
> 1 file changed, 1 insertion(+)
>
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -796,6 +796,7 @@ static int init_overlay_changeset(struct
> if (!fragment->target) {
> of_node_put(fragment->overlay);
> ret = -EINVAL;
> + of_node_put(node);
> goto err_free_fragments;
> }
>
Reviewed-by: Frank Rowand <frank.rowand@sony.com>
Tested-by: Frank Rowand <frank.rowand@sony.com>
While reading through the code touched by the patch I noticed that
the clean up at label err_free_fragments does not do the required
of_node_put() calls. I'll add creating a patch to fix that to my
todo list.
-Frank
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] of: overlay: fix for_each_child.cocci warnings
2021-03-22 18:21 [PATCH] of: overlay: fix for_each_child.cocci warnings Julia Lawall
2021-03-22 22:02 ` Frank Rowand
@ 2021-03-24 20:00 ` Rob Herring
1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2021-03-24 20:00 UTC (permalink / raw)
To: Julia Lawall
Cc: linux-kernel, Pantelis Antoniou, Sumera Priyadarsini,
Rob Herring, devicetree, Frank Rowand, kbuild-all
On Mon, 22 Mar 2021 19:21:39 +0100, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
>
> Function "for_each_child_of_node" should have of_node_put() before goto.
>
> Generated by: scripts/coccinelle/iterators/for_each_child.cocci
>
> Fixes: 82c2d81361ec ("coccinelle: iterators: Add for_each_child.cocci script")
> CC: Sumera Priyadarsini <sylphrenadin@gmail.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
> ---
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: 812da4d39463a060738008a46cfc9f775e4bfcf6
> commit: 82c2d81361ecd142a54e84a9da1e287113314a4f coccinelle: iterators: Add for_each_child.cocci script
> :::::: branch date: 13 hours ago
> :::::: commit date: 5 months ago
>
> overlay.c | 1 +
> 1 file changed, 1 insertion(+)
>
> --- a/drivers/of/overlay.c
> +++ b/drivers/of/overlay.c
> @@ -796,6 +796,7 @@ static int init_overlay_changeset(struct
> if (!fragment->target) {
> of_node_put(fragment->overlay);
> ret = -EINVAL;
> + of_node_put(node);
> goto err_free_fragments;
> }
>
>
>
Applied, thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-24 20:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-22 18:21 [PATCH] of: overlay: fix for_each_child.cocci warnings Julia Lawall
2021-03-22 22:02 ` Frank Rowand
2021-03-24 20:00 ` Rob Herring
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).