lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200605024714.46178-1-navid.emamdoost@gmail.com>
Date:   Thu,  4 Jun 2020 21:47:13 -0500
From:   Navid Emamdoost <navid.emamdoost@...il.com>
To:     Lee Jones <lee.jones@...aro.org>, patches@...nsource.cirrus.com,
        linux-kernel@...r.kernel.org
Cc:     emamd001@....edu, wu000273@....edu, kjlu@....edu, smccaman@....edu,
        Navid Emamdoost <navid.emamdoost@...il.com>
Subject: [PATCH] mfd: 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_sync if
pm_runtime_get_sync fails.

Signed-off-by: Navid Emamdoost <navid.emamdoost@...il.com>
---
 drivers/mfd/arizona-core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c
index f73cf76d1373..5b3191b6534a 100644
--- a/drivers/mfd/arizona-core.c
+++ b/drivers/mfd/arizona-core.c
@@ -46,8 +46,10 @@ int arizona_clk32k_enable(struct arizona *arizona)
 		switch (arizona->pdata.clk32k_src) {
 		case ARIZONA_32KZ_MCLK1:
 			ret = pm_runtime_get_sync(arizona->dev);
-			if (ret != 0)
+			if (ret != 0) {
+				pm_runtime_put_sync(arizona->dev);
 				goto err_ref;
+			}
 			ret = clk_prepare_enable(arizona->mclk[ARIZONA_MCLK1]);
 			if (ret != 0) {
 				pm_runtime_put_sync(arizona->dev);
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ