[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200605025207.65719-1-navid.emamdoost@gmail.com>
Date: Thu, 4 Jun 2020 21:52:07 -0500
From: Navid Emamdoost <navid.emamdoost@...il.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
patches@...nsource.cirrus.com, linux-gpio@...r.kernel.org,
linux-kernel@...r.kernel.org
Cc: emamd001@....edu, wu000273@....edu, kjlu@....edu, smccaman@....edu,
Navid Emamdoost <navid.emamdoost@...il.com>
Subject: [PATCH] gpio: arizona: handle pm_runtime_get_sync failure case
Calling pm_runtime_get_sync increments the counter even in case of
failure, causing incorrect ref count. Call pm_runtime_put if
pm_runtime_get_sync fails.
Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
drivers/gpio/gpio-arizona.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/gpio/gpio-arizona.c b/drivers/gpio/gpio-arizona.c
index 5640efe5e750..7520a13b4c7c 100644
--- a/drivers/gpio/gpio-arizona.c
+++ b/drivers/gpio/gpio-arizona.c
@@ -106,6 +106,7 @@ static int arizona_gpio_direction_out(struct gpio_chip *chip,
ret = pm_runtime_get_sync(chip->parent);
if (ret < 0) {
dev_err(chip->parent, "Failed to resume: %d\n", ret);
+ pm_runtime_put(chip->parent);
return ret;
}
}
--
2.17.1
Powered by blists - more mailing lists