Commit e4aec4da authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski
Browse files

gpiolib: Fix the error path order in gpiochip_add_data_with_key()



After shuffling the code, error path wasn't updated correctly.
Fix it here.

Fixes: 2f4133bb ("gpiolib: No need to call gpiochip_remove_pin_ranges() twice")
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 530b1dbd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -999,11 +999,11 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data,
	gpiochip_irqchip_free_valid_mask(gc);
err_remove_acpi_chip:
	acpi_gpiochip_remove(gc);
	gpiochip_remove_pin_ranges(gc);
err_remove_of_chip:
	gpiochip_free_hogs(gc);
	of_gpiochip_remove(gc);
err_free_gpiochip_mask:
	gpiochip_remove_pin_ranges(gc);
	gpiochip_free_valid_mask(gc);
err_remove_from_list:
	spin_lock_irqsave(&gpio_lock, flags);