The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: He Ying <heying24@huawei.com>
To: <galak@kernel.crashing.org>, <timur@freescale.com>, <arnd@arndb.de>
Cc: <linux-kernel@vger.kernel.org>
Subject: [PATCH] fsl_hypervisor: Add missing of_node_put in fsl_hypervisor_init
Date: Thu, 28 Oct 2021 23:20:02 -0400	[thread overview]
Message-ID: <20211029032002.97355-1-heying24@huawei.com> (raw)

Early exits from for_each_compatible_node() should decrement the
node reference counter.

Signed-off-by: He Ying <heying24@huawei.com>
Fixes: 6db7199407ca ("drivers/virt: introduce Freescale hypervisor management driver")
---
 drivers/virt/fsl_hypervisor.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
index 46ee0a0998b6..ef5fcca4b8f0 100644
--- a/drivers/virt/fsl_hypervisor.c
+++ b/drivers/virt/fsl_hypervisor.c
@@ -849,8 +849,10 @@ static int __init fsl_hypervisor_init(void)
 		}
 
 		dbisr = kzalloc(sizeof(*dbisr), GFP_KERNEL);
-		if (!dbisr)
+		if (!dbisr) {
+			of_node_put(np);
 			goto out_of_memory;
+		}
 
 		dbisr->irq = irq;
 		dbisr->doorbell = be32_to_cpup(handle);
-- 
2.17.1


             reply	other threads:[~2021-10-29  3:18 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-29  3:20 He Ying [this message]
2021-11-09  2:07 ` [PATCH] fsl_hypervisor: Add missing of_node_put in fsl_hypervisor_init He Ying

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=20211029032002.97355-1-heying24@huawei.com \
    --to=heying24@huawei.com \
    --cc=arnd@arndb.de \
    --cc=galak@kernel.crashing.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=timur@freescale.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