aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/lockdep.c
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@o2.pl>2006-12-06 23:36:23 -0500
committerLinus Torvalds <torvalds@woody.osdl.org>2006-12-07 11:39:33 -0500
commitb23984d0a12a4821b2e9712c71550f321eb88bb5 (patch)
treec47470186b47e8e53d8c78513d374b38319abea4 /kernel/lockdep.c
parent910b1b2e6d7d10e1c3bffdd12a90ec82f535f9a5 (diff)
[PATCH] lockdep: misc fixes in lockdep.c
- numeric string size replaced with constant in print_lock_name and print_lockdep_cache, - return on null pointer in print_lock_dependencies, - one more lockdep return with 0 with unlocking fix in mark_lock. Signed-off-by: Jarek Poplawski <jarkao2@o2.pl> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/lockdep.c')
-rw-r--r--kernel/lockdep.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index f76a24f2ac20..300d61bb314b 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -359,7 +359,7 @@ get_usage_chars(struct lock_class *class, char *c1, char *c2, char *c3, char *c4
359 359
360static void print_lock_name(struct lock_class *class) 360static void print_lock_name(struct lock_class *class)
361{ 361{
362 char str[128], c1, c2, c3, c4; 362 char str[KSYM_NAME_LEN + 1], c1, c2, c3, c4;
363 const char *name; 363 const char *name;
364 364
365 get_usage_chars(class, &c1, &c2, &c3, &c4); 365 get_usage_chars(class, &c1, &c2, &c3, &c4);
@@ -381,7 +381,7 @@ static void print_lock_name(struct lock_class *class)
381static void print_lockdep_cache(struct lockdep_map *lock) 381static void print_lockdep_cache(struct lockdep_map *lock)
382{ 382{
383 const char *name; 383 const char *name;
384 char str[128]; 384 char str[KSYM_NAME_LEN + 1];
385 385
386 name = lock->name; 386 name = lock->name;
387 if (!name) 387 if (!name)
@@ -451,7 +451,9 @@ static void print_lock_dependencies(struct lock_class *class, int depth)
451 print_lock_class_header(class, depth); 451 print_lock_class_header(class, depth);
452 452
453 list_for_each_entry(entry, &class->locks_after, entry) { 453 list_for_each_entry(entry, &class->locks_after, entry) {
454 DEBUG_LOCKS_WARN_ON(!entry->class); 454 if (DEBUG_LOCKS_WARN_ON(!entry->class))
455 return;
456
455 print_lock_dependencies(entry->class, depth + 1); 457 print_lock_dependencies(entry->class, depth + 1);
456 458
457 printk("%*s ... acquired at:\n",depth,""); 459 printk("%*s ... acquired at:\n",depth,"");
@@ -1733,6 +1735,7 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this,
1733 debug_atomic_dec(&nr_unused_locks); 1735 debug_atomic_dec(&nr_unused_locks);
1734 break; 1736 break;
1735 default: 1737 default:
1738 __raw_spin_unlock(&hash_lock);
1736 debug_locks_off(); 1739 debug_locks_off();
1737 WARN_ON(1); 1740 WARN_ON(1);
1738 return 0; 1741 return 0;