Skip to content

Commit e11e9b5

Browse files
author
Octavian Purdila
committed
Merge pull request torvalds#135 from pscollins/free-initial-syscall-thread
lkl: Free all memory for the initial syscall thread
2 parents 74caed1 + bebe5e6 commit e11e9b5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

arch/lkl/include/asm/syscalls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define _ASM_LKL_SYSCALLS_H
33

44
int initial_syscall_thread(void *);
5+
void free_initial_syscall_thread(void);
56
long lkl_syscall(long no, long *params);
67

78
#define sys_mmap sys_ni_syscall

arch/lkl/kernel/setup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ long lkl_sys_halt(void)
138138
lkl_ops->sem_free(idle_sem);
139139
lkl_ops->sem_free(init_sem);
140140

141+
free_initial_syscall_thread();
142+
141143
return 0;
142144
}
143145

arch/lkl/kernel/syscalls.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,3 +363,9 @@ int initial_syscall_thread(void *sem)
363363
return ret;
364364
}
365365

366+
void free_initial_syscall_thread(void)
367+
{
368+
/* NB: .completion is freed in lkl_sys_halt, because it is
369+
* allocated in the LKL init routine. */
370+
lkl_ops->sem_free(default_syscall_thread_data.mutex);
371+
}

0 commit comments

Comments
 (0)