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]
Date:	Sat, 25 Jun 2016 00:42:09 +0530
From:	Arvind Yadav <arvind.yadav.cs@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	linux-mips@...ux-mips.org, Arvind Yadav <arvind.yadav.cs@...il.com>
Subject: [PATCH] cpu_pm :Dummy cpu_pm_register_notifier should return error code.

The inline cpu_pm_register_notifier stub simply allows compilation
on systems with CONFIG_CPU_PM disabled. The dummy
cpu_pm_register_notifier does not register an trap_pm_init,
r4k_tlb_init_pm and r4k_cache_init_pm at all.The inline
cpu_pm_register_notifier should return to indicate lack of support
when attempting to register an cpu_pm_register_notifier on such a
system with CONFIG_CPU_PM disabled.

The return value of cpu_pm_register_notifier is in trap_pm_init,
r4k_tlb_init_pm and r4k_cache_init_pm where CONFIG_CPU_PM is disable,
all other places do not care about the return value.
So cpu_pm_register_notifier must returning -ENODEV.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@...il.com>
---
 include/linux/cpu_pm.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/linux/cpu_pm.h b/include/linux/cpu_pm.h
index 455b233..206c264 100644
--- a/include/linux/cpu_pm.h
+++ b/include/linux/cpu_pm.h
@@ -20,6 +20,7 @@
 
 #include <linux/kernel.h>
 #include <linux/notifier.h>
+#include <linux/errno.h>
 
 /*
  * When a CPU goes to a low power state that turns off power to the CPU's
@@ -78,7 +79,7 @@ int cpu_cluster_pm_exit(void);
 
 static inline int cpu_pm_register_notifier(struct notifier_block *nb)
 {
-	return 0;
+	return -ENODEV;
 }
 
 static inline int cpu_pm_unregister_notifier(struct notifier_block *nb)
-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ