summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2010-02-08 22:49:34 +0000
committerShaun Ruffell <sruffell@digium.com>2010-02-08 22:49:34 +0000
commitd362580f3905e3dbd729bacdc601dd3deea2d295 (patch)
treeaa8cc8a81d0c715bda824e0a3ebe782d29531809
parentf497e0eb03bcafc162d47f74b6b2e72b17c164de (diff)
wctdm24xxp, wcte12xp: Abort the search for modules if killed.
If the user kills the modprobe process that is initializing the modules, exit as soon as possible and do not look for any other modules. git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@8007 a0bf4364-ded3-4de4-8d8a-66a801d63aff
-rw-r--r--drivers/dahdi/wctdm24xxp/base.c6
-rw-r--r--drivers/dahdi/wcte12xp/base.c3
-rw-r--r--include/dahdi/kernel.h6
3 files changed, 14 insertions, 1 deletions
diff --git a/drivers/dahdi/wctdm24xxp/base.c b/drivers/dahdi/wctdm24xxp/base.c
index 976d744..73f0db6 100644
--- a/drivers/dahdi/wctdm24xxp/base.c
+++ b/drivers/dahdi/wctdm24xxp/base.c
@@ -3584,6 +3584,9 @@ static int wctdm_locate_modules(struct wctdm *wc)
/* Reset modules */
for (x=0;x<wc->cards;x++) {
int sane=0,ret=0,readi=0;
+
+ if (fatal_signal_pending(current))
+ break;
retry:
/* Init with Auto Calibration */
if (!(ret = wctdm_init_proslic(wc, x, 0, 0, sane))) {
@@ -3645,6 +3648,9 @@ retry:
}
}
+ if (fatal_signal_pending(current))
+ return -EINTR;
+
if (!vpmsupport) {
printk(KERN_NOTICE "VPM: Support Disabled\n");
} else if (!wctdm_vpm_init(wc)) {
diff --git a/drivers/dahdi/wcte12xp/base.c b/drivers/dahdi/wcte12xp/base.c
index e365845..d153234 100644
--- a/drivers/dahdi/wcte12xp/base.c
+++ b/drivers/dahdi/wcte12xp/base.c
@@ -38,6 +38,7 @@
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/delay.h>
+#include <linux/sched.h>
#include <dahdi/kernel.h>
@@ -1395,7 +1396,7 @@ static int t1_hardware_post_init(struct t1 *wc)
t1_setleds(wc, wc->ledstate);
#ifdef VPM_SUPPORT
- if (vpmsupport) {
+ if (!fatal_signal_pending(current) && vpmsupport) {
memset(&options, 0, sizeof(options));
options.debug = debug;
options.vpmnlptype = vpmnlptype;
diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h
index 96c4076..9d87728 100644
--- a/include/dahdi/kernel.h
+++ b/include/dahdi/kernel.h
@@ -1176,6 +1176,11 @@ static inline short dahdi_txtone_nextsample(struct dahdi_chan *ss)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 31)
#define KERN_CONT ""
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 25)
+static inline int fatal_signal_pending(struct task_struct *p)
+{
+ return signal_pending(p) && sigismember(&p->pending.signal, SIGKILL);
+}
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 18)
static inline void list_replace(struct list_head *old, struct list_head *new)
{
@@ -1202,6 +1207,7 @@ wait_for_completion_timeout(struct completion *x, unsigned long timeout)
#endif /* 2.6.11 */
#endif /* 2.6.14 */
#endif /* 2.6.18 */
+#endif /* 2.6.25 */
#endif /* 2.6.31 */
#ifndef DMA_BIT_MASK