aboutsummaryrefslogtreecommitdiff
path: root/lib/stackdepot.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-12-12 14:49:35 +0100
committerTakashi Iwai <tiwai@suse.de>2024-12-12 14:49:35 +0100
commit7b26bc6582b13a52a42a4a9765e8f30d58a81198 (patch)
tree80737d9bb4abf42b8e2061a5edacdfbe5ac9b7d6 /lib/stackdepot.c
parentb2e538a9827dd04ab5273bf4be8eb2edb84357b0 (diff)
parent255cc582e6e16191a20d54bcdbca6c91d3e90c5e (diff)
downloadlinux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.gz
linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.tar.bz2
linux-7b26bc6582b13a52a42a4a9765e8f30d58a81198.zip
Merge tag 'asoc-fix-v6.12-rc2' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v6.13 A small pile of driver specific fixes, all quite small and not particularly major.
Diffstat (limited to 'lib/stackdepot.c')
-rw-r--r--lib/stackdepot.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/stackdepot.c b/lib/stackdepot.c
index 5ed34cc963fc..245d5b416699 100644
--- a/lib/stackdepot.c
+++ b/lib/stackdepot.c
@@ -630,7 +630,15 @@ depot_stack_handle_t stack_depot_save_flags(unsigned long *entries,
prealloc = page_address(page);
}
- raw_spin_lock_irqsave(&pool_lock, flags);
+ if (in_nmi()) {
+ /* We can never allocate in NMI context. */
+ WARN_ON_ONCE(can_alloc);
+ /* Best effort; bail if we fail to take the lock. */
+ if (!raw_spin_trylock_irqsave(&pool_lock, flags))
+ goto exit;
+ } else {
+ raw_spin_lock_irqsave(&pool_lock, flags);
+ }
printk_deferred_enter();
/* Try to find again, to avoid concurrently inserting duplicates. */