Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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")
Cc: stable@vger.kernel.org
Signed-off-by: Ethan Tidmore <ethantidmore06@gmail.com>
Link: https://patch.msgid.link/20260214044531.43539-1-ethantidmore06@gmail.com
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>

authored by

Ethan Tidmore and committed by
Bartosz Golaszewski
58433885 d7017821

+3
+3
drivers/gpio/gpio-nomadik.c
··· 430 430 #ifdef CONFIG_PINCTRL_NOMADIK 431 431 if (mode == NMK_GPIO_ALT_C && pctldev) { 432 432 desc = gpio_device_get_desc(chip->gpiodev, offset); 433 + if (IS_ERR(desc)) 434 + return; 435 + 433 436 mode = nmk_prcm_gpiocr_get_mode(pctldev, desc_to_gpio(desc)); 434 437 } 435 438 #endif