All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Lee Jones" <lee@kernel.org>, linux-gpio@vger.kernel.org
Subject: Re: [PATCH 05/10] pinctrl: nuvoton: npcm8xx: Propagate npcm8xx_gpio_register() error in probe
Date: Wed, 11 Nov 2026 22:32:34 +0000	[thread overview]
Message-ID: <sashiko-outbox-209804@kernel.org> (raw)
In-Reply-To: <20261111215256.1982044-6-lee@kernel.org>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [Medium] pinctrl: nuvoton: iomap leak in npcm7xx_gpio_of() and
  npcm8xx_gpio_fw() [1]
--

commit 86095407b58f80f7127008d829c751165be4ce58
Author: Lee Jones <lee@kernel.org>

pinctrl: nuvoton: npcm8xx: Propagate npcm8xx_gpio_register() error in probe

This commit adds the missing return statement in npcm8xx_pinctrl_probe() so
that errors from npcm8xx_gpio_register() are propagated by dev_err_probe().

> diff --git a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
> index b695a682b4342..39fcd05fc522c 100644
> --- a/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
> +++ b/drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c
> @@ -2582,7 +2582,7 @@ static int npcm8xx_pinctrl_probe(struct platform_device *pdev)
>  
>  	ret = npcm8xx_gpio_register(pctrl);
>  	if (ret < 0)
> -		dev_err_probe(dev, ret, "Failed to register gpio\n");
> +		return dev_err_probe(dev, ret, "Failed to register gpio\n");

[Severity: Medium]
This problem wasn't introduced by this patch, but does returning an error here
(or on earlier error paths in npcm8xx_pinctrl_probe() and npcm7xx_pinctrl_probe())
leak the pctrl->gpio_bank[id].base MMIO mappings [1]?

npcm8xx_gpio_fw() and npcm7xx_gpio_of() map each bank's registers with
unmanaged fwnode_iomap(), and nothing calls iounmap() when a later bank
initialization step, devm_pinctrl_register(), or GPIO registration fails:

drivers/pinctrl/nuvoton/pinctrl-npcm8xx.c:npcm8xx_gpio_fw() {
    ...
	for_each_gpiochip_node(dev, child) {
		pctrl->gpio_bank[id].base = fwnode_iomap(child, 0);
		if (!pctrl->gpio_bank[id].base)
			return dev_err_probe(dev, -ENXIO, "fwnode_iomap id %d failed\n", id);
    ...
}

[1] https://sashiko.dev/#/bug/linux-cf83b9c0-f3a2-4dc8-95a0-af6fafb6d092

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261111215256.1982044-1-lee@kernel.org?part=5

  reply	other threads:[~2026-11-11 22:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-11 21:51 [PATCH 00/10] pinctrl: Fix resource leaks, out-of-bounds accesses, and error handling (batch 2) Lee Jones
2026-11-11 21:51 ` [PATCH 01/10] pinctrl: nuvoton: ma35: Unmap reg_base and release clock on probe error Lee Jones
2026-11-11 21:51 ` [PATCH 02/10] pinctrl: nuvoton: ma35: Prevent out-of-bounds write in ma35_pinctrl_get_soc_data() Lee Jones
2026-11-11 22:31   ` sashiko-bot
2026-11-11 21:51 ` [PATCH 03/10] pinctrl: nuvoton: ma35: Assign fwnode to gpio_chip in ma35_gpiolib_register() Lee Jones
2026-11-11 21:51 ` [PATCH 04/10] pinctrl: nuvoton: ma35: Avoid leaking map when parent node is missing Lee Jones
2026-11-11 22:34   ` sashiko-bot
2026-11-11 21:51 ` [PATCH 05/10] pinctrl: nuvoton: npcm8xx: Propagate npcm8xx_gpio_register() error in probe Lee Jones
2026-11-11 22:32   ` sashiko-bot [this message]
2026-11-11 21:51 ` [PATCH 06/10] pinctrl: nuvoton: npcm7xx: Fix fwnode_irq_get() error check in npcm7xx_gpio_of() Lee Jones
2026-11-11 21:51 ` [PATCH 07/10] pinctrl: single: Reject invalid register width in pcs_probe() Lee Jones
2026-11-11 21:51 ` [PATCH 08/10] pinctrl: single: Free pinconf settings array in pcs_dt_free_map() Lee Jones
2026-11-11 21:51 ` [PATCH 09/10] pinctrl: sunplus: Validate pin_func index in sppctl_dt_node_to_map() Lee Jones
2026-11-12  6:27   ` Andrew Gaylard
2026-11-11 21:51 ` [PATCH 10/10] pinctrl: realtek: rtd1625: Set dcycle_offset to NA for pins without duty-cycle support Lee Jones
2026-11-12  8:55   ` Yu-Chun Lin [林祐君]

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-209804@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=lee@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --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 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.