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>] [day] [month] [year] [list]
Message-ID: <20170901150726.GC7569@spreadtrum.com>
Date:   Fri, 1 Sep 2017 20:37:26 +0530
From:   gaurav jindal <gauravjindal1104@...il.com>
To:     rjw@...ysocki.net, daniel.lezcano@...aro.org
Cc:     linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] cpudile: optimize cpuidle_enable_device error handling

do not fetch per cpu drv id cpuidle_curr_governor is NULL.
if cpuidle_enable_device is NULL return -EIO. it prevents
the addtional per cpu processing

Signed-off-by: Gaurav Jindal<gauravjindal1104@...il.com>

---

diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c
index 1519716..6464e09 100644
--- a/drivers/cpuidle/cpuidle.c
+++ b/drivers/cpuidle/cpuidle.c
@@ -367,9 +367,12 @@ int cpuidle_enable_device(struct cpuidle_device *dev)
 	if (dev->enabled)
 		return 0;

+	if (!cpuidle_curr_governor)
+		return -EIO;
+
 	drv = cpuidle_get_cpu_driver(dev);

-	if (!drv || !cpuidle_curr_governor)
+	if (!drv)
 		return -EIO;

 	if (!dev->registered)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ