Skip to content

Commit 3324e6e

Browse files
committed
Merge tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull locking fix from Borislav Petkov: "Fix a NULL ptr dereference when dumping lockdep chains through /proc/lockdep_chains" * tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: lockdep: Correct lock_classes index mapping
2 parents 2221773 + 28df029 commit 3324e6e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/locking/lockdep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3462,7 +3462,7 @@ struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i)
34623462
u16 chain_hlock = chain_hlocks[chain->base + i];
34633463
unsigned int class_idx = chain_hlock_class_idx(chain_hlock);
34643464

3465-
return lock_classes + class_idx - 1;
3465+
return lock_classes + class_idx;
34663466
}
34673467

34683468
/*
@@ -3530,7 +3530,7 @@ static void print_chain_keys_chain(struct lock_chain *chain)
35303530
hlock_id = chain_hlocks[chain->base + i];
35313531
chain_key = print_chain_key_iteration(hlock_id, chain_key);
35323532

3533-
print_lock_name(lock_classes + chain_hlock_class_idx(hlock_id) - 1);
3533+
print_lock_name(lock_classes + chain_hlock_class_idx(hlock_id));
35343534
printk("\n");
35353535
}
35363536
}

0 commit comments

Comments
 (0)