mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peng Wu <wupeng58@huawei.com>
To: <airlied@linux.ie>, <daniel@ffwll.ch>
Cc: <dri-devel@lists.freedesktop.org>, <linux-kernel@vger.kernel.org>,
	<liwei391@huawei.com>, <wupeng58@huawei.com>
Subject: [PATCH] drm: logicvc: Add missing of_node_put() in logicvc_drm_config_parse()
Date: Tue, 14 Jun 2022 06:24:56 +0000	[thread overview]
Message-ID: <20220614062456.56189-1-wupeng58@huawei.com> (raw)

of_get_child_by_name() returns a node pointer with refcount
incremented, we should use of_node_put() on it when not need anymore.
Add missing of_node_put() to avoid refcount leak.

Signed-off-by: Peng Wu <wupeng58@huawei.com>
Reported-by: Hulk Robot <hulkci@huawei.com>
---
 drivers/gpu/drm/logicvc/logicvc_drm.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/logicvc/logicvc_drm.c b/drivers/gpu/drm/logicvc/logicvc_drm.c
index df1805cf0f95..73d51a8b693e 100644
--- a/drivers/gpu/drm/logicvc/logicvc_drm.c
+++ b/drivers/gpu/drm/logicvc/logicvc_drm.c
@@ -136,8 +136,10 @@ static int logicvc_drm_config_parse(struct logicvc_drm *logicvc)
 	if (!config->layers_count) {
 		drm_err(drm_dev,
 			"Missing a non-optional layers children node\n");
+		of_node_put(layers_node);
 		return -EINVAL;
 	}
+	of_node_put(layers_node);
 
 	return 0;
 }
-- 
2.17.1


                 reply	other threads:[~2022-06-14  6:30 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=20220614062456.56189-1-wupeng58@huawei.com \
    --to=wupeng58@huawei.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=liwei391@huawei.com \
    /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®