
From: James Morris <jmorris@redhat.com>

Atomic underflow debugging in this kernel exposed a bug in the AVC RCU
code, fix below.  The effect of this bug would be delayed node reclamation.

Signed-off-by: James Morris <jmorris@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/security/selinux/avc.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN security/selinux/avc.c~selinux-atomic_dec_and_test-bug security/selinux/avc.c
--- 25/security/selinux/avc.c~selinux-atomic_dec_and_test-bug	2004-11-16 23:31:24.910338296 -0800
+++ 25-akpm/security/selinux/avc.c	2004-11-16 23:31:24.914337688 -0800
@@ -274,7 +274,7 @@ static inline int avc_reclaim_node(void)
 			continue;
 
 		list_for_each_entry(node, &avc_cache.slots[hvalue], list) {
-			if (!atomic_dec_and_test(&node->ae.used)) {
+			if (atomic_dec_and_test(&node->ae.used)) {
 				/* Recently Unused */
 				avc_node_delete(node);
 				ecx++;
_
