diff options
Diffstat (limited to 'kernel/locking/lockdep.c')
-rw-r--r-- | kernel/locking/lockdep.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c index 1123e7e6c78d..9c4e2a7547d3 100644 --- a/kernel/locking/lockdep.c +++ b/kernel/locking/lockdep.c | |||
@@ -3582,6 +3582,11 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
3582 | { | 3582 | { |
3583 | unsigned int new_mask = 1 << new_bit, ret = 1; | 3583 | unsigned int new_mask = 1 << new_bit, ret = 1; |
3584 | 3584 | ||
3585 | if (new_bit >= LOCK_USAGE_STATES) { | ||
3586 | DEBUG_LOCKS_WARN_ON(1); | ||
3587 | return 0; | ||
3588 | } | ||
3589 | |||
3585 | /* | 3590 | /* |
3586 | * If already set then do not dirty the cacheline, | 3591 | * If already set then do not dirty the cacheline, |
3587 | * nor do any checks: | 3592 | * nor do any checks: |
@@ -3605,25 +3610,13 @@ static int mark_lock(struct task_struct *curr, struct held_lock *this, | |||
3605 | return 0; | 3610 | return 0; |
3606 | 3611 | ||
3607 | switch (new_bit) { | 3612 | switch (new_bit) { |
3608 | #define LOCKDEP_STATE(__STATE) \ | ||
3609 | case LOCK_USED_IN_##__STATE: \ | ||
3610 | case LOCK_USED_IN_##__STATE##_READ: \ | ||
3611 | case LOCK_ENABLED_##__STATE: \ | ||
3612 | case LOCK_ENABLED_##__STATE##_READ: | ||
3613 | #include "lockdep_states.h" | ||
3614 | #undef LOCKDEP_STATE | ||
3615 | ret = mark_lock_irq(curr, this, new_bit); | ||
3616 | if (!ret) | ||
3617 | return 0; | ||
3618 | break; | ||
3619 | case LOCK_USED: | 3613 | case LOCK_USED: |
3620 | debug_atomic_dec(nr_unused_locks); | 3614 | debug_atomic_dec(nr_unused_locks); |
3621 | break; | 3615 | break; |
3622 | default: | 3616 | default: |
3623 | if (!debug_locks_off_graph_unlock()) | 3617 | ret = mark_lock_irq(curr, this, new_bit); |
3618 | if (!ret) | ||
3624 | return 0; | 3619 | return 0; |
3625 | WARN_ON(1); | ||
3626 | return 0; | ||
3627 | } | 3620 | } |
3628 | 3621 | ||
3629 | graph_unlock(); | 3622 | graph_unlock(); |