]> Git Repo - J-linux.git/blobdiff - lib/debugobjects.c
HID: hid-sensor-custom: Fix big on-stack allocation in hid_sensor_custom_get_known()
[J-linux.git] / lib / debugobjects.c
index 337d797a714163460d2e89e55b6cce443d1b52db..df86e649d8be08125c1469259755ff7fb4b7d3fc 100644 (file)
@@ -437,6 +437,7 @@ static int object_cpu_offline(unsigned int cpu)
        struct debug_percpu_free *percpu_pool;
        struct hlist_node *tmp;
        struct debug_obj *obj;
+       unsigned long flags;
 
        /* Remote access is safe as the CPU is dead already */
        percpu_pool = per_cpu_ptr(&percpu_obj_pool, cpu);
@@ -444,6 +445,12 @@ static int object_cpu_offline(unsigned int cpu)
                hlist_del(&obj->node);
                kmem_cache_free(obj_cache, obj);
        }
+
+       raw_spin_lock_irqsave(&pool_lock, flags);
+       obj_pool_used -= percpu_pool->obj_free;
+       debug_objects_freed += percpu_pool->obj_free;
+       raw_spin_unlock_irqrestore(&pool_lock, flags);
+
        percpu_pool->obj_free = 0;
 
        return 0;
@@ -500,9 +507,9 @@ static void debug_print_object(struct debug_obj *obj, char *msg)
                        descr->debug_hint(obj->object) : NULL;
                limit++;
                WARN(1, KERN_ERR "ODEBUG: %s %s (active state %u) "
-                                "object type: %s hint: %pS\n",
+                                "object: %p object type: %s hint: %pS\n",
                        msg, obj_states[obj->state], obj->astate,
-                       descr->name, hint);
+                       obj->object, descr->name, hint);
        }
        debug_objects_warnings++;
 }
@@ -1318,6 +1325,8 @@ static int __init debug_objects_replace_static_objects(void)
                hlist_add_head(&obj->node, &objects);
        }
 
+       debug_objects_allocated += i;
+
        /*
         * debug_objects_mem_init() is now called early that only one CPU is up
         * and interrupts have been disabled, so it is safe to replace the
@@ -1386,6 +1395,7 @@ void __init debug_objects_mem_init(void)
                debug_objects_enabled = 0;
                kmem_cache_destroy(obj_cache);
                pr_warn("out of memory.\n");
+               return;
        } else
                debug_objects_selftest();
 
This page took 0.027316 seconds and 4 git commands to generate.