Commit 382280ae authored by Bartlomiej Zolnierkiewicz's avatar Bartlomiej Zolnierkiewicz Committed by Greg Kroah-Hartman

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: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c43254c1
...@@ -163,7 +163,7 @@ typedef struct pid * THREAD_PID; ...@@ -163,7 +163,7 @@ typedef struct pid * THREAD_PID;
#define THREAD_PID_INIT_VALUE NULL #define THREAD_PID_INIT_VALUE NULL
#define GET_PID(_v) find_get_pid(_v) #define GET_PID(_v) find_get_pid(_v)
#define GET_PID_NUMBER(_v) pid_nr(_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) #define KILL_THREAD_PID(_A, _B, _C) kill_pid(_A, _B, _C)
#endif #endif
......
...@@ -1063,7 +1063,7 @@ VOID RT28xxThreadTerminate( ...@@ -1063,7 +1063,7 @@ VOID RT28xxThreadTerminate(
} }
#endif #endif
#ifdef RT30xx #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)); printk("Terminate the MLMEThr_pid=%d!\n", pid_nr(pObj->MLMEThr_pid));
mb(); mb();
...@@ -1084,7 +1084,7 @@ VOID RT28xxThreadTerminate( ...@@ -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)); printk("Terminate the RTUSBCmdThr_pid=%d!\n", pid_nr(pObj->RTUSBCmdThr_pid));
mb(); mb();
...@@ -1106,7 +1106,7 @@ VOID RT28xxThreadTerminate( ...@@ -1106,7 +1106,7 @@ VOID RT28xxThreadTerminate(
pObj->RTUSBCmdThr_pid = NULL; pObj->RTUSBCmdThr_pid = NULL;
} }
} }
if (pObj->TimerQThr_pid >= 0) if (pid_nr(pObj->TimerQThr_pid) > 0)
{ {
POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie; POS_COOKIE pObj = (POS_COOKIE)pAd->OS_Cookie;
printk("Terminate the TimerQThr_pid=%d!\n", pid_nr(pObj->TimerQThr_pid)); printk("Terminate the TimerQThr_pid=%d!\n", pid_nr(pObj->TimerQThr_pid));
......
...@@ -460,14 +460,14 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs); ...@@ -460,14 +460,14 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs);
#define RTUSBMlmeUp(pAd) \ #define RTUSBMlmeUp(pAd) \
{ \ { \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
if(pObj->MLMEThr_pid>0) \ if (pid_nr(pObj->MLMEThr_pid) > 0) \
up(&(pAd->mlme_semaphore)); \ up(&(pAd->mlme_semaphore)); \
} }
#define RTUSBCMDUp(pAd) \ #define RTUSBCMDUp(pAd) \
{ \ { \
POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \ POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; \
if(pObj->RTUSBCmdThr_pid>0) \ if (pid_nr(pObj->RTUSBCmdThr_pid) > 0) \
up(&(pAd->RTUSBCmd_semaphore)); \ up(&(pAd->RTUSBCmd_semaphore)); \
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment