aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 259db207b5d9..8a0efac4f99d 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -4088,7 +4088,7 @@ void debug_check_no_locks_freed(const void *mem_from, unsigned long mem_len)
4088} 4088}
4089EXPORT_SYMBOL_GPL(debug_check_no_locks_freed); 4089EXPORT_SYMBOL_GPL(debug_check_no_locks_freed);
4090 4090
4091static void print_held_locks_bug(void) 4091static void print_held_locks_bug(struct task_struct *curr)
4092{ 4092{
4093 if (!debug_locks_off()) 4093 if (!debug_locks_off())
4094 return; 4094 return;
@@ -4097,21 +4097,22 @@ static void print_held_locks_bug(void)
4097 4097
4098 printk("\n"); 4098 printk("\n");
4099 printk("=====================================\n"); 4099 printk("=====================================\n");
4100 printk("[ BUG: %s/%d still has locks held! ]\n", 4100 printk("[ BUG: lock held at task exit time! ]\n");
4101 current->comm, task_pid_nr(current));
4102 print_kernel_ident(); 4101 print_kernel_ident();
4103 printk("-------------------------------------\n"); 4102 printk("-------------------------------------\n");
4104 lockdep_print_held_locks(current); 4103 printk("%s/%d is exiting with locks still held!\n",
4104 curr->comm, task_pid_nr(curr));
4105 lockdep_print_held_locks(curr);
4106
4105 printk("\nstack backtrace:\n"); 4107 printk("\nstack backtrace:\n");
4106 dump_stack(); 4108 dump_stack();
4107} 4109}
4108 4110
4109void debug_check_no_locks_held(void) 4111void debug_check_no_locks_held(struct task_struct *task)
4110{ 4112{
4111 if (unlikely(current->lockdep_depth > 0)) 4113 if (unlikely(task->lockdep_depth > 0))
4112 print_held_locks_bug(); 4114 print_held_locks_bug(task);
4113} 4115}
4114EXPORT_SYMBOL_GPL(debug_check_no_locks_held);
4115 4116
4116void debug_show_all_locks(void) 4117void debug_show_all_locks(void)
4117{ 4118{