소스 검색

[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>
Albrecht Dre 20 년 전
부모
커밋
105bb2698b
1개의 변경된 파일4개의 추가작업 그리고 0개의 파일을 삭제
  1. 4 0
      arch/arm/mach-s3c2410/dma.c

+ 4 - 0
arch/arm/mach-s3c2410/dma.c

@@ -785,6 +785,10 @@ int s3c2410_dma_free(dmach_t channel, s3c2410_dma_client_t *client)
 	chan->client = NULL;
 	chan->in_use = 0;
 
+	if (chan->irq_claimed)
+		free_irq(chan->irq, (void *)chan);
+	chan->irq_claimed = 0;
+
 	local_irq_restore(flags);
 
 	return 0;