mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] gpio: it87: balance superio enter/exit calls in error path
@ 2025-12-09  6:12 Bartosz Golaszewski
  2025-12-09 14:42 ` Daniel Gibson
  0 siblings, 1 reply; 3+ messages in thread
From: Bartosz Golaszewski @ 2025-12-09  6:12 UTC (permalink / raw)
  To: Linus Walleij, Peng Fan, Bartosz Golaszewski
  Cc: linux-gpio, linux-kernel, Bartosz Golaszewski, Daniel Gibson

We always call superio_enter() in it87_gpio_direction_out() but only
call superio_exit() if the call to it87_gpio_set() succeeds. Move the
label to balance the calls in error path as well.

Fixes: ef877a159072 ("gpio: it87: use new line value setter callbacks")
Reported-by: Daniel Gibson <daniel@gibson.sh>
Closes: https://lore.kernel.org/all/bd0a00e3-9b8c-43e8-8772-e67b91f4c71e@gibson.sh/
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
---
 drivers/gpio/gpio-it87.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/gpio/gpio-it87.c b/drivers/gpio/gpio-it87.c
index 5d677bcfccf2..528ac1890613 100644
--- a/drivers/gpio/gpio-it87.c
+++ b/drivers/gpio/gpio-it87.c
@@ -254,9 +254,8 @@ static int it87_gpio_direction_out(struct gpio_chip *chip,
 	if (rc)
 		goto exit;
 
-	superio_exit();
-
 exit:
+	superio_exit();
 	spin_unlock(&it87_gpio->lock);
 	return rc;
 }
-- 
2.51.0


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

end of thread, other threads:[~2025-12-10  5:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-09  6:12 [PATCH] gpio: it87: balance superio enter/exit calls in error path Bartosz Golaszewski
2025-12-09 14:42 ` Daniel Gibson
2025-12-10  5:28   ` Bartosz Golaszewski

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

all inboxes | Powered by JetHome®