All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Jason Cooper <jason@lakedaemon.net>
Cc: Huacai Chen <chenhc@lemote.com>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v4 1/8] irqchip/loongson-htpic: Remove redundant kfree operation
Date: Thu, 16 Jul 2020 11:16:23 +0800	[thread overview]
Message-ID: <1594869390-21053-2-git-send-email-yangtiezhu@loongson.cn> (raw)
In-Reply-To: <1594869390-21053-1-git-send-email-yangtiezhu@loongson.cn>

In the function htpic_of_init(), when kzalloc htpic fails, it should
return -ENOMEM directly, no need to execute "goto" to kfree.

Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/irqchip/irq-loongson-htpic.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/irqchip/irq-loongson-htpic.c b/drivers/irqchip/irq-loongson-htpic.c
index dd018c2..63f7280 100644
--- a/drivers/irqchip/irq-loongson-htpic.c
+++ b/drivers/irqchip/irq-loongson-htpic.c
@@ -93,10 +93,8 @@ int __init htpic_of_init(struct device_node *node, struct device_node *parent)
 	}
 
 	htpic = kzalloc(sizeof(*htpic), GFP_KERNEL);
-	if (!htpic) {
-		err = -ENOMEM;
-		goto out_free;
-	}
+	if (!htpic)
+		return -ENOMEM;
 
 	htpic->base = of_iomap(node, 0);
 	if (!htpic->base) {
-- 
2.1.0


  reply	other threads:[~2020-07-16  3:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-16  3:16 [PATCH v4 0/8] irqchip: Fix some issues and do some code cleanups about Loongson Tiezhu Yang
2020-07-16  3:16 ` Tiezhu Yang [this message]
2020-07-16  3:16 ` [PATCH v4 2/8] irqchip/loongson-htpic: Remove unneeded select of I8259 Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 3/8] irqchip/loongson-htvec: Fix potential resource leak Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 4/8] irqchip/loongson-htvec: Check return value of irq_domain_translate_onecell() Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 5/8] irqchip/loongson-pch-pic: Check return value of irq_domain_translate_twocell() Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 6/8] irqchip/loongson-pch-msi: Remove unneeded variable Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 7/8] irqchip/loongson-liointc: Fix potential dead lock Tiezhu Yang
2020-07-16  3:16 ` [PATCH v4 8/8] dt-bindings: interrupt-controller: Fix typos in loongson,liointc.yaml Tiezhu Yang
2020-07-16 19:08   ` Rob Herring
2020-07-17 12:55     ` Marc Zyngier
2020-07-16  8:45 [PATCH v4 1/8] irqchip/loongson-htpic: Remove redundant kfree operation Markus Elfring

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=1594869390-21053-2-git-send-email-yangtiezhu@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=chenhc@lemote.com \
    --cc=jason@lakedaemon.net \
    --cc=jiaxun.yang@flygoat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maz@kernel.org \
    --cc=tglx@linutronix.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 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.