Linux kernel and device drivers for NXP i.MX platforms
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Peng Fan" <peng.fan@linux.dev>
Cc: imx@lists.linux.dev, Frank.Li@kernel.org
Subject: Re: [PATCH 3/8] irqchip/imx-intmux: Handle platform_irq_count() errors
Date: Tue, 17 Nov 2026 07:26:22 +0000	[thread overview]
Message-ID: <sashiko-outbox-218338@kernel.org> (raw)
In-Reply-To: <20261117-imx-intmux-v1-3-189e7e0ad98d@nxp.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] irqchip/imx-intmux: inaccurate commit message claim on
  platform_irq_count()
--

commit 4b2c3c2659aa7c57d57499f3c306054374c5ecd2
Author: Peng Fan <peng.fan@nxp.com>

> irqchip/imx-intmux: Handle platform_irq_count() errors
>
> platform_irq_count() returns a negative errno on failure, but the driver
> only special-cased -EPROBE_DEFER. For any other negative value probe
> continued with a negative channel count and passed it to
> devm_kzalloc_flex(), which is broken.
>
> Propagate every negative return value and also reject a zero channel
> count, which would otherwise register a controller without any channels.
>
> Fixes: 2fbb13961e74 ("irqchip: Add NXP INTMUX interrupt multiplexer support")
> Signed-off-by: Peng Fan <peng.fan@nxp.com>

[Severity: Low]
Is the commit message accurate about what platform_irq_count() can return?

platform_irq_count() only returns -EPROBE_DEFER or a non-negative count,
never any other negative errno:

drivers/base/platform.c:platform_irq_count() {
	int ret, nr = 0;

	while ((ret = platform_get_irq_optional(dev, nr)) >= 0)
		nr++;

	if (ret == -EPROBE_DEFER)
		return ret;

	return nr;
}

A negative channum could not reach devm_kzalloc_flex() before this patch;
the functional fix here is rejecting a zero channel count when no
interrupts are found or index 0 fails with a non-deferral error.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261117-imx-intmux-v1-0-189e7e0ad98d@nxp.com?part=3

  reply	other threads:[~2026-11-17  7:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  7:14 [PATCH 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan
2026-11-17  7:14 ` [PATCH 1/8] irqchip/imx-intmux: Fix probe error path Peng Fan
2026-11-17  7:26   ` sashiko-bot
2026-11-17  7:14 ` [PATCH 2/8] irqchip/imx-intmux: Dispose IRQ mappings on remove Peng Fan
2026-11-17  7:14 ` [PATCH 3/8] irqchip/imx-intmux: Handle platform_irq_count() errors Peng Fan
2026-11-17  7:26   ` sashiko-bot [this message]
2026-11-17  7:14 ` [PATCH 4/8] irqchip/imx-intmux: Don't WARN on malformed interrupt specifiers Peng Fan
2026-11-17  7:14 ` [PATCH 5/8] irqchip/imx-intmux: Mark input interrupts as level-triggered Peng Fan
2026-11-17  7:22   ` sashiko-bot
2026-11-17  7:14 ` [PATCH 6/8] irqchip/imx-intmux: Use devm_clk_get_enabled() Peng Fan
2026-11-17  7:28   ` sashiko-bot
2026-11-17  7:14 ` [PATCH 7/8] irqchip/imx-intmux: Use devm_irq_domain_create_linear() Peng Fan
2026-11-17  7:14 ` [PATCH 8/8] irqchip/imx-intmux: Use devm_pm_runtime_set_active_enabled() Peng Fan
2026-11-17  7:38   ` sashiko-bot
2026-11-17 13:27 ` [PATCH 0/8] irqchip/imx-intmux: Fix and modernize resource management Peng Fan

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=sashiko-outbox-218338@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=Frank.Li@kernel.org \
    --cc=imx@lists.linux.dev \
    --cc=peng.fan@linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    /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