diff options
Diffstat (limited to 'lib/dma-debug.c')
-rw-r--r-- | lib/dma-debug.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/dma-debug.c b/lib/dma-debug.c index 13ef2338be41..66ce41489133 100644 --- a/lib/dma-debug.c +++ b/lib/dma-debug.c | |||
@@ -78,7 +78,7 @@ static LIST_HEAD(free_entries); | |||
78 | static DEFINE_SPINLOCK(free_entries_lock); | 78 | static DEFINE_SPINLOCK(free_entries_lock); |
79 | 79 | ||
80 | /* Global disable flag - will be set in case of an error */ | 80 | /* Global disable flag - will be set in case of an error */ |
81 | static bool global_disable __read_mostly; | 81 | static u32 global_disable __read_mostly; |
82 | 82 | ||
83 | /* Global error count */ | 83 | /* Global error count */ |
84 | static u32 error_count; | 84 | static u32 error_count; |
@@ -430,7 +430,7 @@ static struct dma_debug_entry *__dma_entry_alloc(void) | |||
430 | */ | 430 | */ |
431 | static struct dma_debug_entry *dma_entry_alloc(void) | 431 | static struct dma_debug_entry *dma_entry_alloc(void) |
432 | { | 432 | { |
433 | struct dma_debug_entry *entry = NULL; | 433 | struct dma_debug_entry *entry; |
434 | unsigned long flags; | 434 | unsigned long flags; |
435 | 435 | ||
436 | spin_lock_irqsave(&free_entries_lock, flags); | 436 | spin_lock_irqsave(&free_entries_lock, flags); |
@@ -438,11 +438,14 @@ static struct dma_debug_entry *dma_entry_alloc(void) | |||
438 | if (list_empty(&free_entries)) { | 438 | if (list_empty(&free_entries)) { |
439 | pr_err("DMA-API: debugging out of memory - disabling\n"); | 439 | pr_err("DMA-API: debugging out of memory - disabling\n"); |
440 | global_disable = true; | 440 | global_disable = true; |
441 | goto out; | 441 | spin_unlock_irqrestore(&free_entries_lock, flags); |
442 | return NULL; | ||
442 | } | 443 | } |
443 | 444 | ||
444 | entry = __dma_entry_alloc(); | 445 | entry = __dma_entry_alloc(); |
445 | 446 | ||
447 | spin_unlock_irqrestore(&free_entries_lock, flags); | ||
448 | |||
446 | #ifdef CONFIG_STACKTRACE | 449 | #ifdef CONFIG_STACKTRACE |
447 | entry->stacktrace.max_entries = DMA_DEBUG_STACKTRACE_ENTRIES; | 450 | entry->stacktrace.max_entries = DMA_DEBUG_STACKTRACE_ENTRIES; |
448 | entry->stacktrace.entries = entry->st_entries; | 451 | entry->stacktrace.entries = entry->st_entries; |
@@ -450,9 +453,6 @@ static struct dma_debug_entry *dma_entry_alloc(void) | |||
450 | save_stack_trace(&entry->stacktrace); | 453 | save_stack_trace(&entry->stacktrace); |
451 | #endif | 454 | #endif |
452 | 455 | ||
453 | out: | ||
454 | spin_unlock_irqrestore(&free_entries_lock, flags); | ||
455 | |||
456 | return entry; | 456 | return entry; |
457 | } | 457 | } |
458 | 458 | ||
@@ -657,7 +657,7 @@ static int dma_debug_fs_init(void) | |||
657 | 657 | ||
658 | global_disable_dent = debugfs_create_bool("disabled", 0444, | 658 | global_disable_dent = debugfs_create_bool("disabled", 0444, |
659 | dma_debug_dent, | 659 | dma_debug_dent, |
660 | (u32 *)&global_disable); | 660 | &global_disable); |
661 | if (!global_disable_dent) | 661 | if (!global_disable_dent) |
662 | goto out_err; | 662 | goto out_err; |
663 | 663 | ||