* [PATCH] alchemy: Fully initialize tcb->self
@ 2019-11-19 16:24 Jan Kiszka
0 siblings, 0 replies; only message in thread
From: Jan Kiszka @ 2019-11-19 16:24 UTC (permalink / raw)
To: Xenomai
From: Jan Kiszka <jan.kiszka@siemens.com>
Make sure the thread field of tcb->self is always initialized as
rt_task_self returns it.
Reported-by: Mauro Salvini <mauro.salvini@smigroup.net>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
lib/alchemy/task.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/alchemy/task.c b/lib/alchemy/task.c
index 079d11b6e7..949a996d00 100644
--- a/lib/alchemy/task.c
+++ b/lib/alchemy/task.c
@@ -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);
--
2.16.4
--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2019-11-19 16:24 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-19 16:24 [PATCH] alchemy: Fully initialize tcb->self Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.