Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH 6.12.y 0/3] gpiolib: backport 16fdabe143fc
@ 2026-06-18 16:02 Quentin Schulz
  2026-06-18 16:02 ` [PATCH 6.12.y 1/3] gpiolib: Extract gpiochip_choose_fwnode() for wider use Quentin Schulz
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Quentin Schulz @ 2026-06-18 16:02 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Greg Kroah-Hartman
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski, Quentin Schulz,
	Andy Shevchenko, Mathieu Dubois-Briand, Tzung-Bi Shih, stable,
	Linus Walleij, Bartosz Golaszewski

Backport 16fdabe143fc ("gpio: Fix resource leaks on errors in
gpiochip_add_data_with_key()") to 6.12.y. To make the git diff more
similar with the upstream commit, also backport 375790f18396 ("gpiolib:
Extract gpiochip_choose_fwnode() for wider use") and 550300b9a295
("gpiolib: Remove redundant assignment of return variable").

The changes between 16fdabe143fc and the third patch of this series is
(according to git-range-diff):

"""
      ## drivers/gpio/gpiolib.c ##
     @@ drivers/gpio/gpiolib.c: static const struct device_type gpio_dev_type = {
    @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, voi
     +	}
     +
     +	gdev->can_sleep = gc->can_sleep;
    -+	rwlock_init(&gdev->line_state_lock);
    -+	RAW_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
    ++	BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
     +	BLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);
     +#ifdef CONFIG_PINCTRL
     +	INIT_LIST_HEAD(&gdev->pin_ranges);
    @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, voi
     -	gdev->ngpio = gc->ngpio;
     -	gdev->can_sleep = gc->can_sleep;
     -
    --	rwlock_init(&gdev->line_state_lock);
    --	RAW_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
    +-	BLOCKING_INIT_NOTIFIER_HEAD(&gdev->line_state_notifier);
     -	BLOCKING_INIT_NOTIFIER_HEAD(&gdev->device_notifier);
     -
     -	ret = init_srcu_struct(&gdev->srcu);
    @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, voi
     @@ drivers/gpio/gpiolib.c: int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
      		ret = gpiodev_add_to_list_unlocked(gdev);
      		if (ret) {
    - 			gpiochip_err(gc, "GPIO integer space overlap, cannot add chip\n");
    + 			chip_err(gc, "GPIO integer space overlap, cannot add chip\n");
     -			goto err_cleanup_desc_srcu;
     +			goto err_put_device;
      		}
"""

s/gpiochip_err/chip_err/ aside, the rest of the diff comes from feature
commits which do not fit the rules for backporting to stable.

Signed-off-by: Quentin Schulz <quentin.schulz@cherry.de>
---
Andy Shevchenko (2):
      gpiolib: Extract gpiochip_choose_fwnode() for wider use
      gpiolib: Remove redundant assignment of return variable

Tzung-Bi Shih (1):
      gpio: Fix resource leaks on errors in gpiochip_add_data_with_key()

 drivers/gpio/gpiolib.c | 156 +++++++++++++++++++++++++------------------------
 1 file changed, 79 insertions(+), 77 deletions(-)
---
base-commit: 1d3a00d3bacff25652c96e1527610c69e91f7c38
change-id: 20260618-6-12-cve-2026-31732-63076d516720

Best regards,
--  
Quentin Schulz <quentin.schulz@cherry.de>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-06-19  4:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 16:02 [PATCH 6.12.y 0/3] gpiolib: backport 16fdabe143fc Quentin Schulz
2026-06-18 16:02 ` [PATCH 6.12.y 1/3] gpiolib: Extract gpiochip_choose_fwnode() for wider use Quentin Schulz
2026-06-18 16:02 ` [PATCH 6.12.y 2/3] gpiolib: Remove redundant assignment of return variable Quentin Schulz
2026-06-18 16:02 ` [PATCH 6.12.y 3/3] gpio: Fix resource leaks on errors in gpiochip_add_data_with_key() Quentin Schulz
2026-06-19  4:07 ` [PATCH 6.12.y 0/3] gpiolib: backport 16fdabe143fc Sasha Levin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox