aboutsummaryrefslogtreecommitdiffstats
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/debugobjects.c')
-rw-r--r--lib/debugobjects.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c
index 0ab9ae8057f0..d11808ca4bc4 100644
--- a/lib/debugobjects.c
+++ b/lib/debugobjects.c
@@ -79,30 +79,29 @@ static const char *obj_states[ODEBUG_STATE_MAX] = {
79 [ODEBUG_STATE_NOTAVAILABLE] = "not available", 79 [ODEBUG_STATE_NOTAVAILABLE] = "not available",
80}; 80};
81 81
82static int fill_pool(void) 82static void fill_pool(void)
83{ 83{
84 gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN; 84 gfp_t gfp = GFP_ATOMIC | __GFP_NORETRY | __GFP_NOWARN;
85 struct debug_obj *new; 85 struct debug_obj *new;
86 unsigned long flags; 86 unsigned long flags;
87 87
88 if (likely(obj_pool_free >= ODEBUG_POOL_MIN_LEVEL)) 88 if (likely(obj_pool_free >= ODEBUG_POOL_MIN_LEVEL))
89 return obj_pool_free; 89 return;
90 90
91 if (unlikely(!obj_cache)) 91 if (unlikely(!obj_cache))
92 return obj_pool_free; 92 return;
93 93
94 while (obj_pool_free < ODEBUG_POOL_MIN_LEVEL) { 94 while (obj_pool_free < ODEBUG_POOL_MIN_LEVEL) {
95 95
96 new = kmem_cache_zalloc(obj_cache, gfp); 96 new = kmem_cache_zalloc(obj_cache, gfp);
97 if (!new) 97 if (!new)
98 return obj_pool_free; 98 return;
99 99
100 raw_spin_lock_irqsave(&pool_lock, flags); 100 raw_spin_lock_irqsave(&pool_lock, flags);
101 hlist_add_head(&new->node, &obj_pool); 101 hlist_add_head(&new->node, &obj_pool);
102 obj_pool_free++; 102 obj_pool_free++;
103 raw_spin_unlock_irqrestore(&pool_lock, flags); 103 raw_spin_unlock_irqrestore(&pool_lock, flags);
104 } 104 }
105 return obj_pool_free;
106} 105}
107 106
108/* 107/*
@@ -1052,10 +1051,10 @@ static int __init debug_objects_replace_static_objects(void)
1052 cnt++; 1051 cnt++;
1053 } 1052 }
1054 } 1053 }
1054 local_irq_enable();
1055 1055
1056 printk(KERN_DEBUG "ODEBUG: %d of %d active objects replaced\n", cnt, 1056 printk(KERN_DEBUG "ODEBUG: %d of %d active objects replaced\n", cnt,
1057 obj_pool_used); 1057 obj_pool_used);
1058 local_irq_enable();
1059 return 0; 1058 return 0;
1060free: 1059free:
1061 hlist_for_each_entry_safe(obj, node, tmp, &objects, node) { 1060 hlist_for_each_entry_safe(obj, node, tmp, &objects, node) {