Skip to content

Commit

Permalink
Merge tag 'locking_urgent_for_v5.17_rc5' of git://git.kernel.org/pub/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
torvalds committed Feb 20, 2022
2 parents 2221773 + 28df029 commit 3324e6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/locking/lockdep.c
Original file line number Diff line number Diff line change
Expand Up @@ -3462,7 +3462,7 @@ struct lock_class *lock_chain_get_class(struct lock_chain *chain, int i)
u16 chain_hlock = chain_hlocks[chain->base + i];
unsigned int class_idx = chain_hlock_class_idx(chain_hlock);

return lock_classes + class_idx - 1;
return lock_classes + class_idx;
}

/*
Expand Down Expand Up @@ -3530,7 +3530,7 @@ static void print_chain_keys_chain(struct lock_chain *chain)
hlock_id = chain_hlocks[chain->base + i];
chain_key = print_chain_key_iteration(hlock_id, chain_key);

print_lock_name(lock_classes + chain_hlock_class_idx(hlock_id) - 1);
print_lock_name(lock_classes + chain_hlock_class_idx(hlock_id));
printk("\n");
}
}
Expand Down

0 comments on commit 3324e6e

Please sign in to comment.