diff options
author | Albrecht Dreß <albrecht.dress@com.rmk.(none)> | 2005-06-03 15:52:26 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2005-06-03 15:52:26 -0400 |
commit | 105bb2698b54a838165947199f1c8be5c2e7d9bb (patch) | |
tree | bd5028148a5299bc1f064bbe631f42b59ba9a21a | |
parent | 4ab5c01c7cc28f29d5cf5f2a591cb6f7bbece48e (diff) |
[PATCH] ARM: 2694/1: [s3c2410/dma] release irq properly to fix kernel oops
Patch from Albrecht Dreß
Problem:
When a module requests a DMA channel via the function s3c2410_dma_request(), this function requests the appropriate irq under the name of the client module. When the client module is unloaded, it calls s3c2410_dma_free() which does not free the irq. Consequently, when e.g. running "cat /proc/interrupts", the irq owner points to freed memory, leading to a kernel oops.
File:
linux/arch/arm/mach-s3c2410/dma.c
Fix:
trivial, below
Signed-off-by: Albrecht Dreß
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r-- | arch/arm/mach-s3c2410/dma.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm/mach-s3c2410/dma.c b/arch/arm/mach-s3c2410/dma.c index bc229fab86d4..c7c28890d406 100644 --- a/arch/arm/mach-s3c2410/dma.c +++ b/arch/arm/mach-s3c2410/dma.c | |||
@@ -785,6 +785,10 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client) | |||
785 | chan->client = NULL; | 785 | chan->client = NULL; |
786 | chan->in_use = 0; | 786 | chan->in_use = 0; |
787 | 787 | ||
788 | if (chan->irq_claimed) | ||
789 | free_irq(chan->irq, (void *)chan); | ||
790 | chan->irq_claimed = 0; | ||
791 | |||
788 | local_irq_restore(flags); | 792 | local_irq_restore(flags); |
789 | 793 | ||
790 | return 0; | 794 | return 0; |