From: Markus Elfring <Markus.Elfring@web.de>
To: Tiezhu Yang <yangtiezhu@loongson.cn>,
devicetree@vger.kernel.org, linux-mips@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
Huacai Chen <chenhc@lemote.com>,
Jason Cooper <jason@lakedaemon.net>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
Marc Zyngier <maz@kernel.org>, Rob Herring <robh+dt@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>,
Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH 1/7] irqchip: Fix potential resource leaks
Date: Tue, 23 Jun 2020 15:55:33 +0000 [thread overview]
Message-ID: <65e734f7-c43c-f96b-3650-980e15edba60@web.de> (raw)
> There exists some potential resource leaks in the error path, fix them.
Will the tag “Fixes” become relevant for the commit message?
…
> +++ b/drivers/irqchip/irq-nvic.c
> @@ -94,6 +94,7 @@ static int __init nvic_of_init(struct device_node *node,
>
> if (!nvic_irq_domain) {
> pr_warn("Failed to allocate irq domain\n");
> + iounmap(nvic_base);
> return -ENOMEM;
> }
>
> @@ -103,6 +104,7 @@ static int __init nvic_of_init(struct device_node *node,
> if (ret) {
> pr_warn("Failed to allocate irq chips\n");
> irq_domain_remove(nvic_irq_domain);
> + iounmap(nvic_base);
> return ret;
> }
Can it helpful to add jump targets so that a bit of exception handling
can be better reused at the end of this function?
Regards,
Markus
next reply other threads:[~2020-06-23 15:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-23 15:55 Markus Elfring [this message]
2020-06-24 1:44 ` [PATCH 1/7] irqchip: Fix potential resource leaks Tiezhu Yang
2020-06-24 8:42 ` [1/7] " Markus Elfring
2020-06-24 9:16 ` Tiezhu Yang
2020-06-24 9:23 ` Markus Elfring
2020-06-24 9:56 ` Tiezhu Yang
2020-06-24 10:06 ` Markus Elfring
2020-06-24 11:30 ` Tiezhu Yang
2020-06-24 12:08 ` Markus Elfring
2020-06-28 3:27 ` Tiezhu Yang
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=65e734f7-c43c-f96b-3650-980e15edba60@web.de \
--to=markus.elfring@web.de \
--cc=chenhc@lemote.com \
--cc=devicetree@vger.kernel.org \
--cc=jason@lakedaemon.net \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=maz@kernel.org \
--cc=robh+dt@kernel.org \
--cc=tglx@linutronix.de \
--cc=yangtiezhu@loongson.cn \
/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;
as well as URLs for NNTP newsgroup(s).