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: <20191216153952.37038-1-jbi.octave@gmail.com>
Date:   Mon, 16 Dec 2019 15:39:52 +0000
From:   Jules Irenge <jbi.octave@...il.com>
To:     boqun.feng@...il.com
Cc:     peterz@...radead.org, mingo@...hat.com, will@...nel.org,
        linux-kernel@...r.kernel.org, Jules Irenge <jbi.octave@...il.com>
Subject: [PATCH] kernel: locking: add releases(lock) annotation

Add releases(lock) annotation to remove issue detected by sparse tool.
warning: context imbalance in xxxxxxx() - unexpected unlock

Signed-off-by: Jules Irenge <jbi.octave@...il.com>
---
 kernel/locking/spinlock.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/locking/spinlock.c b/kernel/locking/spinlock.c
index 0ff08380f531..bb088fcf2be5 100644
--- a/kernel/locking/spinlock.c
+++ b/kernel/locking/spinlock.c
@@ -187,6 +187,7 @@ EXPORT_SYMBOL(_raw_spin_unlock);
 
 #ifndef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE
 void __lockfunc _raw_spin_unlock_irqrestore(raw_spinlock_t *lock, unsigned long flags)
+	__releases(lock)
 {
 	__raw_spin_unlock_irqrestore(lock, flags);
 }
@@ -203,6 +204,7 @@ EXPORT_SYMBOL(_raw_spin_unlock_irq);
 
 #ifndef CONFIG_INLINE_SPIN_UNLOCK_BH
 void __lockfunc _raw_spin_unlock_bh(raw_spinlock_t *lock)
+	__releases(lock)
 {
 	__raw_spin_unlock_bh(lock);
 }
@@ -275,6 +277,7 @@ EXPORT_SYMBOL(_raw_read_unlock_irq);
 
 #ifndef CONFIG_INLINE_READ_UNLOCK_BH
 void __lockfunc _raw_read_unlock_bh(rwlock_t *lock)
+	__releases(lock)
 {
 	__raw_read_unlock_bh(lock);
 }
@@ -331,6 +334,7 @@ EXPORT_SYMBOL(_raw_write_unlock);
 
 #ifndef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE
 void __lockfunc _raw_write_unlock_irqrestore(rwlock_t *lock, unsigned long flags)
+	__releases(lock)
 {
 	__raw_write_unlock_irqrestore(lock, flags);
 }
@@ -347,6 +351,7 @@ EXPORT_SYMBOL(_raw_write_unlock_irq);
 
 #ifndef CONFIG_INLINE_WRITE_UNLOCK_BH
 void __lockfunc _raw_write_unlock_bh(rwlock_t *lock)
+	__releases(lock)
 {
 	__raw_write_unlock_bh(lock);
 }
-- 
2.23.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ