lib/copperplate: Also deregister main thread from registry sysgroup
PATCH 1/1 lib/copperplate: Also deregister main thread from registry sysgroup
From: Jan Kiszka <[email protected]>
Before 6b4337fed433, we were leaking the object so that the forgotten deregistration caused no major harm. Now that we delete it, it's easy to crash on later accesses to the thread sysgroup.
Reported-by Mauro Salvini <[email protected]>
Signed-off-by Jan Kiszka <[email protected]>
--- lib/copperplate/threadobj.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
lib/copperplate/threadobj.c +4 -1
@@ -1773,7 +1773,10 @@ int threadobj_set_schedprio(struct threadobj *thobj, int priority)#ifdef CONFIG_XENO_PSHARED static void main_exit (void ) { -threadobj_free (threadobj_current ()); +struct threadobj *thobj =threadobj_current (); + +sysgroup_remove (thread, &thobj->memspec); +threadobj_free (thobj); }#endif
Signature · 1 line
2.35.3