kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Tiezhu Yang <yangtiezhu@loongson.cn>, linux-mips@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jason Cooper <jason@lakedaemon.net>,
	Marc Zyngier <maz@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Xuefeng Li <lixuefeng@loongson.cn>
Subject: Re: [PATCH v3 03/14] irqchip/csky-mpintc: Fix potential resource leaks
Date: Wed, 24 Jun 2020 11:43:03 +0000	[thread overview]
Message-ID: <a0ace7a8-5c26-ee20-fe76-7dff57a18ca3@web.de> (raw)

> There exists potential resource leaks in the error path, fix them.

I suggest to improve this change description.
How do you think about another wording variant?

   Specific system resources were not released in a few error cases.
   Thus add jump targets for the completion of the desired exception handling.


…
+++ b/drivers/irqchip/irq-csky-mpintc.c
@@ -247,8 +247,10 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
…
 		INTCG_base = ioremap(mfcr("cr<31, 14>"),
 				     INTCL_SIZE*nr_cpu_ids + INTCG_SIZE);

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?id=3e08a95294a4fb3702bb3d35ed08028433c37fe6#n257


…
+		if (INTCG_base == NULL) {


Would you like to use the following code variant?

See also:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/scripts/checkpatch.pl?id=3e08a95294a4fb3702bb3d35ed08028433c37fe6#n5756

+		if (!INTCG_base) {


…
> @@ -270,12 +274,22 @@ csky_mpintc_init(struct device_node *node, struct device_node *parent)
>
>  #ifdef CONFIG_SMP
>  	ipi_irq = irq_create_mapping(root_domain, IPI_IRQ);
> +	if (!ipi_irq) {
> +		ret = -EIO;
> +		goto err_domain_remove;
> +	}
…

Can the function call “irq_domain_remove(root_domain)” become relevant
only if the preprocessor symbol “CONFIG_SMP” was defined?

Regards,
Markus

             reply	other threads:[~2020-06-24 11:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-24 11:43 Markus Elfring [this message]
2020-06-24 12:07 ` [PATCH v3 03/14] irqchip/csky-mpintc: Fix potential resource leaks Tiezhu Yang
2020-06-24 12:21   ` [v3 " 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=a0ace7a8-5c26-ee20-fe76-7dff57a18ca3@web.de \
    --to=markus.elfring@web.de \
    --cc=jason@lakedaemon.net \
    --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=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).