gpio: nomadik: Add missing IS_ERR() check
Subsystems (3)
PATCH 1/1 gpio: nomadik: Add missing IS_ERR() check
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")
Signed-off-by Ethan Tidmore <[email protected]>
--- drivers/gpio/gpio-nomadik.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpio/gpio-nomadik.c +3 -0
@@ -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
Signature · 1 line
2.53.0
Bartosz Golaszewski
AppliedQuoted 4 lines · Ethan Tidmore
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,
Signature · 1 line
Bartosz Golaszewski <[email protected]>
Quoted 6 lines · Ethan Tidmore
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")Signed-off-by Ethan Tidmore <[email protected]>
Great catch!
Reviewed-by Linus Walleij <[email protected]>
Yours,
Linus Walleij