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:	Sat,  6 Jul 2013 17:41:25 +0530
From:	Ramkumar Ramachandra <artagnon@...il.com>
To:	LKML <linux-kernel@...r.kernel.org>
Cc:	Yinghai Lu <yinghai@...nel.org>,
	Thomas Gleixner <tglx@...utronix.de>
Subject: [PATCH 2/3] apic: add lock annotations to squelch sparse warnings

sparse, being a static analyzer, emits the following warnings:

  context imbalance in 'lock_vector_lock' - wrong count at exit
  context imbalance in 'unlock_vector_lock' - unexpected unlock

Help it by annotating the pair of functions with __acquires and
__releases.

Cc: Yinghai Lu <yinghai@...nel.org>
Cc: Thomas Gleixner <tglx@...utronix.de>
Signed-off-by: Ramkumar Ramachandra <artagnon@...il.com>
---
 arch/x86/kernel/apic/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 9ed796c..b756417 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -1061,6 +1061,7 @@ int IO_APIC_get_PCI_irq_vector(int bus, int slot, int pin,
 EXPORT_SYMBOL(IO_APIC_get_PCI_irq_vector);
 
 void lock_vector_lock(void)
+	__acquires(&vector_lock)
 {
 	/* Used to the online set of cpus does not change
 	 * during assign_irq_vector.
@@ -1069,6 +1070,7 @@ void lock_vector_lock(void)
 }
 
 void unlock_vector_lock(void)
+	__releases(&vector_lock)
 {
 	raw_spin_unlock(&vector_lock);
 }
-- 
1.8.3.2.733.gf8abaeb

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ