projects/linux·commit 96ea975b

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security

96ea975b · Linus Torvalds <[email protected]> · 2014-09-12 09:24:46 -07:00

Pull assoc array garbage collection fix from James Morris.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security:
  KEYS: Fix termination condition in assoc array garbage collection
Commit
96ea975bfeec855d119bb93df885d7f18452856a
Parents
5874cfed · 95389b08

Merge commit. Changes below are compared with the first parent: 5874cfed.

Changes

1 files changed · +3 −1

FileStatusAddDelContent
lib/assoc_array.cmodified+3−1View file

lib/assoc_array.c

View file
diff --git a/lib/assoc_array.c b/lib/assoc_array.c
index ae146f0..2404d03 100644
--- a/lib/assoc_array.c
+++ b/lib/assoc_array.c
@@ -1723,11 +1723,13 @@ ascend_old_tree:
shortcut = assoc_array_ptr_to_shortcut(ptr);
slot = shortcut->parent_slot;
cursor = shortcut->back_pointer;
+ if (!cursor)
+ goto gc_complete;
} else {
slot = node->parent_slot;
cursor = ptr;
}
- BUG_ON(!ptr);
+ BUG_ON(!cursor);
node = assoc_array_ptr_to_node(cursor);
slot++;
goto continue_node;