From: Wan Jiabing <wanjiabing@vivo.com>
To: Rob Herring <robh+dt@kernel.org>,
Frank Rowand <frowand.list@gmail.com>,
Javier Martinez Canillas <javierm@redhat.com>,
Thomas Zimmermann <tzimmermann@suse.de>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Wan Jiabing <wanjiabing@vivo.com>,
kernel test robot <lkp@intel.com>, Rob Herring <robh@kernel.org>
Subject: [PATCH v2] of: Add missing of_node_put() before return
Date: Fri, 22 Apr 2022 09:53:31 +0800 [thread overview]
Message-ID: <20220422015331.120632-1-wanjiabing@vivo.com> (raw)
Fix the following coccicheck error:
drivers/of/platform.c:554:2-23: WARNING: Function for_each_node_by_type
should have of_node_put() before return around line 560.
Early exits from for_each_node_by_type() should decrement the
node reference counter.
Fixes: 52b1b46c39ae ("of: Create platform devices for OF framebuffers")
Reported-by: kernel test robot <lkp@intel.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
---
Changelog:
v2:
- Add a missing ';'.
---
drivers/of/platform.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/of/platform.c b/drivers/of/platform.c
index 2dff3a3d137c..1bb895feb06d 100644
--- a/drivers/of/platform.c
+++ b/drivers/of/platform.c
@@ -556,8 +556,10 @@ static int __init of_platform_default_populate_init(void)
!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;
}
--
2.35.1
reply other threads:[~2022-04-22 1:54 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220422015331.120632-1-wanjiabing@vivo.com \
--to=wanjiabing@vivo.com \
--cc=devicetree@vger.kernel.org \
--cc=frowand.list@gmail.com \
--cc=javierm@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=robh+dt@kernel.org \
--cc=robh@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®