All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] of: fix for_each_child.cocci warnings
  2022-04-21  6:45 [drm-misc:drm-misc-next 1/3] drivers/of/platform.c:558:2-23: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 564 kernel test robot
@ 2022-04-21  6:36 ` kernel test robot
  0 siblings, 0 replies; 2+ messages in thread
From: kernel test robot @ 2022-04-21  6:36 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1751 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Zimmermann <tzimmermann@suse.de>
CC: Javier Martinez Canillas <javierm@redhat.com>
CC: Rob Herring <robh@kernel.org>
CC: Frank Rowand <frowand.list@gmail.com>
CC: devicetree(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org

From: kernel test robot <lkp@intel.com>

drivers/of/platform.c:558:2-23: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 564.


Semantic patch information:
 False positives can be due to function calls within the for_each
 loop that may encapsulate an of_node_put.

Generated by: scripts/coccinelle/iterators/for_each_child.cocci

Fixes: 52b1b46c39ae ("of: Create platform devices for OF framebuffers")
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
---

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   40d8d4bd06720aed6c1125bab7296c57de4f1157
commit: 52b1b46c39ae4321459a1a28dd4e596497b375b8 [1/3] of: Create platform devices for OF framebuffers
:::::: branch date: 6 hours ago
:::::: commit date: 22 hours ago

Please take the patch only if it's a positive warning. Thanks!

 drivers/of/platform.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -560,8 +560,10 @@ static int __init of_platform_default_po
 			    !of_get_property(node, "linux,boot-display", NULL))
 				continue;
 			dev = of_platform_device_create(node, "of-display", NULL);
-			if (WARN_ON(!dev))
+			if (WARN_ON(!dev)) {
+				of_node_put(node);
 				return -ENOMEM;
+			}
 			boot_display = node;
 			break;
 		}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [drm-misc:drm-misc-next 1/3] drivers/of/platform.c:558:2-23: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 564.
@ 2022-04-21  6:45 kernel test robot
  2022-04-21  6:36 ` [PATCH] of: fix for_each_child.cocci warnings kernel test robot
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2022-04-21  6:45 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 1142 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Thomas Zimmermann <tzimmermann@suse.de>
CC: Javier Martinez Canillas <javierm@redhat.com>
CC: Rob Herring <robh@kernel.org>

tree:   git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head:   40d8d4bd06720aed6c1125bab7296c57de4f1157
commit: 52b1b46c39ae4321459a1a28dd4e596497b375b8 [1/3] of: Create platform devices for OF framebuffers
:::::: branch date: 6 hours ago
:::::: commit date: 22 hours ago
config: riscv-randconfig-c024-20220420 (https://download.01.org/0day-ci/archive/20220421/202204211444.I1BZwETk-lkp(a)intel.com/config)
compiler: riscv64-linux-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Julia Lawall <julia.lawall@lip6.fr>


cocci warnings: (new ones prefixed by >>)
>> drivers/of/platform.c:558:2-23: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 564.

Please review and possibly fold the followup patch.

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-04-21  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-21  6:45 [drm-misc:drm-misc-next 1/3] drivers/of/platform.c:558:2-23: WARNING: Function "for_each_node_by_type" should have of_node_put() before return around line 564 kernel test robot
2022-04-21  6:36 ` [PATCH] of: fix for_each_child.cocci warnings kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.