aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/lockdep.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/kernel/lockdep.c b/kernel/lockdep.c
index 723bd9f92556..4335f12a27c6 100644
--- a/kernel/lockdep.c
+++ b/kernel/lockdep.c
@@ -2943,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size)
2943 struct list_head *head; 2943 struct list_head *head;
2944 unsigned long flags; 2944 unsigned long flags;
2945 int i; 2945 int i;
2946 int locked;
2946 2947
2947 raw_local_irq_save(flags); 2948 raw_local_irq_save(flags);
2948 graph_lock(); 2949 locked = graph_lock();
2949 2950
2950 /* 2951 /*
2951 * Unhash all classes that were created by this module: 2952 * Unhash all classes that were created by this module:
@@ -2959,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size)
2959 zap_class(class); 2960 zap_class(class);
2960 } 2961 }
2961 2962
2962 graph_unlock(); 2963 if (locked)
2964 graph_unlock();
2963 raw_local_irq_restore(flags); 2965 raw_local_irq_restore(flags);
2964} 2966}
2965 2967
@@ -2969,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
2969 struct list_head *head; 2971 struct list_head *head;
2970 unsigned long flags; 2972 unsigned long flags;
2971 int i, j; 2973 int i, j;
2974 int locked;
2972 2975
2973 raw_local_irq_save(flags); 2976 raw_local_irq_save(flags);
2974 2977
@@ -2987,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock)
2987 * Debug check: in the end all mapped classes should 2990 * Debug check: in the end all mapped classes should
2988 * be gone. 2991 * be gone.
2989 */ 2992 */
2990 graph_lock(); 2993 locked = graph_lock();
2991 for (i = 0; i < CLASSHASH_SIZE; i++) { 2994 for (i = 0; i < CLASSHASH_SIZE; i++) {
2992 head = classhash_table + i; 2995 head = classhash_table + i;
2993 if (list_empty(head)) 2996 if (list_empty(head))
@@ -3000,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock)
3000 } 3003 }
3001 } 3004 }
3002 } 3005 }
3003 graph_unlock(); 3006 if (locked)
3007 graph_unlock();
3004 3008
3005out_restore: 3009out_restore:
3006 raw_local_irq_restore(flags); 3010 raw_local_irq_restore(flags);