summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-08-16 21:30:12 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2009-09-15 12:02:18 -0700
commit382280ae9d0f94a7ffed1f8963be16b96348684c (patch)
treebf59b2ea9142fe06175d8ed7e19a1426fce0ab0d
parentc43254c13aebeb7ed1e3534ad77d8dc98dc6475f (diff)
Staging: rtxxx0: PID checking fixes
* rt3070: - add missing pid_nr() invocations * rt{28,30}70: - do not treat PID 0 as valid Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/rt2860/rt_linux.h2
-rw-r--r--drivers/staging/rt2870/2870_main_dev.c6
-rw-r--r--drivers/staging/rt2870/rt2870.h4
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h
index dbe6fb75d6cb..37b63e24e734 100644
--- a/drivers/staging/rt2860/rt_linux.h
+++ b/drivers/staging/rt2860/rt_linux.h
@@ -163,7 +163,7 @@ typedef struct pid * THREAD_PID;
#define THREAD_PID_INIT_VALUE NULL
#define GET_PID(_v) find_get_pid(_v)
#define GET_PID_NUMBER(_v) pid_nr(_v)
-#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) >= 0)
+#define CHECK_PID_LEGALITY(_pid) if (pid_nr(_pid) > 0)
#define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C)
#endif
diff --git a/drivers/staging/rt2870/2870_main_dev.c b/drivers/staging/rt2870/2870_main_dev.c
index 9900e8d03045..9b8ec40ea873 100644
--- a/drivers/staging/rt2870/2870_main_dev.c
+++ b/drivers/staging/rt2870/2870_main_dev.c
@@ -1063,7 +1063,7 @@ VOID RT28xxThreadTerminate(
}
#endif
#ifdef RT30xx
- if (pObj->MLMEThr_pid)
+ if (pid_nr(pObj->MLMEThr_pid) > 0)
{
printk("Terminate the MLMEThr_pid=%d!\n", pid_nr(pObj->MLMEThr_pid));
mb();
@@ -1084,7 +1084,7 @@ VOID RT28xxThreadTerminate(
}
}
- if (pObj->RTUSBCmdThr_pid >= 0)
+ if (pid_nr(pObj->RTUSBCmdThr_pid) > 0)
{
printk("Terminate the RTUSBCmdThr_pid=%d!\n", pid_nr(pObj->RTUSBCmdThr_pid));
mb();
@@ -1106,7 +1106,7 @@ VOID RT28xxThreadTerminate(
pObj->RTUSBCmdThr_pid = NULL;
}
}
- if (pObj->TimerQThr_pid >= 0)
+ if (pid_nr(pObj->TimerQThr_pid) > 0)
{
POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
printk("Terminate the TimerQThr_pid=%d!\n", pid_nr(pObj->TimerQThr_pid));
diff --git a/drivers/staging/rt2870/rt2870.h b/drivers/staging/rt2870/rt2870.h
index 56a6dd0c3e46..f0b1f2f1273e 100644
--- a/drivers/staging/rt2870/rt2870.h
+++ b/drivers/staging/rt2870/rt2870.h
@@ -460,14 +460,14 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
#define RTUSBMlmeUp(pAd) \
{ \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if(pObj->MLMEThr_pid>0) \
+ if (pid_nr(pObj->MLMEThr_pid) > 0) \
up(&(pAd->mlme_semaphore)); \
}
#define RTUSBCMDUp(pAd) \
{ \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
- if(pObj->RTUSBCmdThr_pid>0) \
+ if (pid_nr(pObj->RTUSBCmdThr_pid) > 0) \
up(&(pAd->RTUSBCmd_semaphore)); \
}
#endif