From: David Schleef Date: Thu, 15 Jun 2000 04:57:32 +0000 (+0000) Subject: fix crash on rmmod dur to free_irq() X-Git-Tag: r0_7_45~8 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=48b050e23a2da7a01ff207bb6722b68e495ee88c;p=comedi.git fix crash on rmmod dur to free_irq() --- diff --git a/comedi/rtai.c b/comedi/rtai.c index e3dbe2d6..69625053 100644 --- a/comedi/rtai.c +++ b/comedi/rtai.c @@ -92,26 +92,40 @@ void rt_pend_irq_handler(void) } } +#define random_pointer ((void *)&rt_pend_tq_init) + int rt_pend_tq_init(void) { rt_pend_head=rt_pend_tail=rt_pend_tq; - return rt_pend_tq_irq=rt_request_srq(0,rt_pend_irq_handler,NULL); + rt_pend_tq_irq=rt_request_srq(0,rt_pend_irq_handler,random_pointer); + if(rt_pend_tq_irq<0){ + rt_pend_tq_irq=0; + printk("rt_pend_tq_init(): couldn't alloc srq\n"); + return -EINVAL; + }else{ + printk("rt_pend_tq_init(): irq=%d\n",rt_pend_tq_irq); + } + return 0; } void rt_pend_tq_cleanup(void) { - free_irq(rt_pend_tq_irq,NULL); + if(rt_pend_tq_irq){ + free_irq(rt_pend_tq_irq,random_pointer); + } } #endif void comedi_rtai_init(void) { + rt_mount_rtai(); rt_pend_tq_init(); } void comedi_rtai_cleanup(void) { rt_pend_tq_cleanup(); + rt_umount_rtai(); }