* [PATCH] gpio: nomadik: Add missing IS_ERR() check
@ 2026-02-14 4:45 Ethan Tidmore
2026-02-16 11:10 ` Bartosz Golaszewski
2026-02-19 17:47 ` Linus Walleij
0 siblings, 2 replies; 3+ messages in thread
From: Ethan Tidmore @ 2026-02-14 4:45 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski
Cc: linux-arm-kernel, linux-gpio, linux-kernel, Ethan Tidmore, stable
The function gpio_device_get_desc() can return an error pointer and is
not checked for one. Add check for error pointer.
Fixes: ddeb66d2cb10f ("gpio: nomadik: don't print out global GPIO numbers in debugfs callbacks")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
---
drivers/gpio/gpio-nomadik.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpio/gpio-nomadik.c b/drivers/gpio/gpio-nomadik.c
index 97c5cd33279d..e22b713166d7 100644
--- a/drivers/gpio/gpio-nomadik.c
+++ b/drivers/gpio/gpio-nomadik.c
@@ -430,6 +430,9 @@ void nmk_gpio_dbg_show_one(struct seq_file *s, struct pinctrl_dev *pctldev,
#ifdef CONFIG_PINCTRL_NOMADIK
if (mode == NMK_GPIO_ALT_C && pctldev) {
desc = gpio_device_get_desc(chip->gpiodev, offset);
+ if (IS_ERR(desc))
+ return;
+
mode = nmk_prcm_gpiocr_get_mode(pctldev, desc_to_gpio(desc));
}
#endif
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: nomadik: Add missing IS_ERR() check
2026-02-14 4:45 [PATCH] gpio: nomadik: Add missing IS_ERR() check Ethan Tidmore
@ 2026-02-16 11:10 ` Bartosz Golaszewski
2026-02-19 17:47 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Bartosz Golaszewski @ 2026-02-16 11:10 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Ethan Tidmore
Cc: Bartosz Golaszewski, linux-arm-kernel, linux-gpio, linux-kernel,
stable
On Fri, 13 Feb 2026 22:45:31 -0600, Ethan Tidmore wrote:
> The function gpio_device_get_desc() can return an error pointer and is
> not checked for one. Add check for error pointer.
>
>
Applied, thanks!
[1/1] gpio: nomadik: Add missing IS_ERR() check
https://git.kernel.org/brgl/c/58433885ee99e8c96757e82ccf6d50646c4dfe09
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] gpio: nomadik: Add missing IS_ERR() check
2026-02-14 4:45 [PATCH] gpio: nomadik: Add missing IS_ERR() check Ethan Tidmore
2026-02-16 11:10 ` Bartosz Golaszewski
@ 2026-02-19 17:47 ` Linus Walleij
1 sibling, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2026-02-19 17:47 UTC (permalink / raw)
To: Ethan Tidmore
Cc: Bartosz Golaszewski, linux-arm-kernel, linux-gpio, linux-kernel,
stable
On Sat, Feb 14, 2026 at 5:45 AM Ethan Tidmore <ethantidmore06@gmail.com> wrote:
> The function gpio_device_get_desc() can return an error pointer and is
> not checked for one. Add check for error pointer.
>
> Fixes: ddeb66d2cb10f ("gpio: nomadik: don't print out global GPIO numbers in debugfs callbacks")
> Cc: stable@vger.kernel.org
> Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Great catch!
Reviewed-by: Linus Walleij <linusw@kernel.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-02-19 17:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-14 4:45 [PATCH] gpio: nomadik: Add missing IS_ERR() check Ethan Tidmore
2026-02-16 11:10 ` Bartosz Golaszewski
2026-02-19 17:47 ` Linus Walleij
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox