alchemy: Fully initialize tcb->self
PATCH 1/1 alchemy: Fully initialize tcb->self
From: Jan Kiszka <[email protected]>
Make sure the thread field of tcb->self is always initialized as rt_task_self returns it.
Reported-by Mauro Salvini <[email protected]>
Signed-off-by Jan Kiszka <[email protected]>
--- lib/alchemy/task.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
lib/alchemy/task.c +4 -2
@@ -443,10 +443,12 @@ int rt_task_create(RT_TASK *task, const char *name, cta.stacksize = stksize; ret =__bt (copperplate_create_thread (&cta, &tcb->thobj.ptid)); -if (ret) +if (ret) {delete_tcb (tcb); -else + }else { + tcb->self.thread = tcb->thobj.ptid; task->thread = tcb->thobj.ptid; + } out:CANCEL_RESTORE (svc);
Signature · 6 lines
2.16.4 -- Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate Competence Center Embedded Linux