From: Markus Elfring <Markus.Elfring@web.de>
To: linux-mips@vger.kernel.org, "Jiri Slaby" <jirislaby@kernel.org>,
"Thomas Bogendörfer" <tsbogend@alpha.franken.de>,
"Thomas Gleixner" <tglx@linutronix.de>
Cc: LKML <linux-kernel@vger.kernel.org>, kernel-janitors@vger.kernel.org
Subject: [PATCH] MIPS: SGI-IP27: Delete an unnecessary check before kfree() in hub_domain_free()
Date: Tue, 10 Jun 2025 12:28:43 +0200 [thread overview]
Message-ID: <d3066a18-2e78-43ae-ad3b-8931777ee265@web.de> (raw)
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 10 Jun 2025 11:44:20 +0200
It can be known that the function “kfree” performs a null pointer check
for its input parameter.
It is therefore not needed to repeat such a check before its call.
Thus remove a redundant pointer check.
The source code was transformed by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
arch/mips/sgi-ip27/ip27-irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/sgi-ip27/ip27-irq.c b/arch/mips/sgi-ip27/ip27-irq.c
index 288d4d17eddd..20ef663af16e 100644
--- a/arch/mips/sgi-ip27/ip27-irq.c
+++ b/arch/mips/sgi-ip27/ip27-irq.c
@@ -165,7 +165,7 @@ static void hub_domain_free(struct irq_domain *domain,
return;
irqd = irq_domain_get_irq_data(domain, virq);
- if (irqd && irqd->chip_data)
+ if (irqd)
kfree(irqd->chip_data);
}
--
2.49.0
next reply other threads:[~2025-06-10 10:29 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 10:28 Markus Elfring [this message]
2025-07-16 18:04 ` [PATCH] MIPS: SGI-IP27: Delete an unnecessary check before kfree() in hub_domain_free() Thomas Bogendoerfer
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=d3066a18-2e78-43ae-ad3b-8931777ee265@web.de \
--to=markus.elfring@web.de \
--cc=jirislaby@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=tsbogend@alpha.franken.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox