This commit fixes maximum boundary checking in sched_gettcb().
If thread or task was created over 32767, g_lastpid value returns
to lower value and it makes wrong comparision in sched_gettcb().
For example)
System thread (pid = 32767) was already created and user creates
one more thread, then user's pid will be allocated lower than system's
thread (1 or above). In this case, not that g_lastpid is same with
user's pid, system's pid can not fit below condition.
(pid > 0 && pid <= g_lastpid)
Change-Id: I9a6d164dd5d7b49e7920e1f597015bd8211b1297
Signed-off-by: Junyeon LEE <junyeon2.lee@samsung.com>
/* Verify that the PID is within range */
- if (pid >= 0 && pid <= g_lastpid) {
+ if (pid >= 0) {
/* Get the hash_ndx associated with the pid */
hash_ndx = PIDHASH(pid);