summaryrefslogtreecommitdiff
path: root/lib/dma-debug.c
diff options
context:
space:
mode:
authorJakub Kicinski <kubakici@wp.pl>2012-04-04 05:19:10 +0400
committerJoerg Roedel <joerg.roedel@amd.com>2012-04-12 14:28:46 +0400
commit29cdd4e4ec91aae239192bb122d377d15a9d75e3 (patch)
tree2407fb9f3c7144d110029ad7d32328dee45758bc /lib/dma-debug.c
parent0034102808e0dbbf3a2394b82b1bb40b5778de9e (diff)
downloadlinux-29cdd4e4ec91aae239192bb122d377d15a9d75e3.tar.xz
dma-debug: release free_entries_lock before saving stack trace
Saving stack trace can take a while and once the entry is allocated free_entries_lock is no longer needed. Signed-off-by: Jakub Kicinski <kubakici@wp.pl> Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r--lib/dma-debug.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index 13ef2338be41..518aea714d21 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -430,7 +430,7 @@ static struct dma_debug_entry *__dma_entry_alloc(void)
*/
static struct dma_debug_entry *dma_entry_alloc(void)
{
- struct dma_debug_entry *entry = NULL;
+ struct dma_debug_entry *entry;
unsigned long flags;
spin_lock_irqsave(&free_entries_lock, flags);
@@ -438,11 +438,14 @@ static struct dma_debug_entry *dma_entry_alloc(void)
if (list_empty(&free_entries)) {
pr_err("DMA-API: debugging out of memory - disabling\n");
global_disable = true;
- goto out;
+ spin_unlock_irqrestore(&free_entries_lock, flags);
+ return NULL;
}
entry = __dma_entry_alloc();
+ spin_unlock_irqrestore(&free_entries_lock, flags);
+
#ifdef CONFIG_STACKTRACE
entry->stacktrace.max_entries = DMA_DEBUG_STACKTRACE_ENTRIES;
entry->stacktrace.entries = entry->st_entries;
@@ -450,9 +453,6 @@ static struct dma_debug_entry *dma_entry_alloc(void)
save_stack_trace(&entry->stacktrace);
#endif
-out:
- spin_unlock_irqrestore(&free_entries_lock, flags);
-
return entry;
}