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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 01 Apr 2018 21:44:15 +0100
From:   David Howells <dhowells@...hat.com>
To:     linux-kernel@...r.kernel.org
Subject: [PATCH 40/45] C++: Fix sema_init()

Fix sema_init() to manually initialise the semaphore rather than using
__SEMAPHORE_INITIALIZER() as that doesn't seem to work on C++.

Signed-off-by: David Howells <dhowells@...hat.com>
---

 include/linux/semaphore.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 11c86fbfeb98..364fb4721db5 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -32,7 +32,10 @@ struct semaphore {
 static inline void sema_init(struct semaphore *sem, int val)
 {
 	static struct lock_class_key __key;
-	*sem = (struct semaphore) __SEMAPHORE_INITIALIZER(*sem, val);
+
+	sem->count = val;
+	INIT_LIST_HEAD(&sem->wait_list);
+	raw_spin_lock_init(&sem->lock);
 	lockdep_init_map(&sem->lock.dep_map, "semaphore->lock", &__key, 0);
 }
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ