Skip to contentSkip to conversation

pinctrl: don't put the reference to GPIO device in pinctrl_pins_show()

PATCH In review Bartosz Golaszewski 2 participants 2 messages Feb 23, 2024 – Feb 29, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pinctrl: don't put the reference to GPIO device in pinctrl_pins_show()

From: Bartosz Golaszewski <[email protected]>

The call to gpiod_to_gpio_device() does not increase the reference count of the GPIO device struct so it must not be decreased. Remove the buggy __free() decorator.

Fixes 524fc108b895 ("pinctrl: stop using gpiod_to_chip()")
---
 drivers/pinctrl/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/core.c +1 -1
index ee56856cb80c..bbcdece83bf4 100644
@@ -1644,7 +1644,7 @@ static int pinctrl_pins_show(struct seq_file *s, void *what)
 	const struct pinctrl_ops *ops = pctldev->desc->pctlops;
 	unsigned int i, pin;
 #ifdef CONFIG_GPIOLIB
-	struct gpio_device *gdev __free(gpio_device_put) = NULL;
+	struct gpio_device *gdev = NULL;
 	struct pinctrl_gpio_range *range;
 	int gpio_num;
 #endif
Signature · 1 line
2.40.1