sched/pidhash: init g_pidhash to NULL to avoid wild pointer
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
591c1563b8
commit
13741c9017
@ -76,7 +76,7 @@ FAR struct tcb_s *nxsched_get_tcb(pid_t pid)
|
||||
|
||||
/* Verify that the correct TCB was found. */
|
||||
|
||||
if (pid == g_pidhash[hash_ndx].pid)
|
||||
if (g_pidhash && pid == g_pidhash[hash_ndx].pid)
|
||||
{
|
||||
/* Return the TCB associated with this pid (if any) */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user