summaryrefslogtreecommitdiff
path: root/src/kernel/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/proc.c')
-rw-r--r--src/kernel/proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/kernel/proc.c b/src/kernel/proc.c
index a8cf303..e7a5ed6 100644
--- a/src/kernel/proc.c
+++ b/src/kernel/proc.c
@@ -114,8 +114,13 @@ void process_kill(struct process *p, int ret) {
p->controlled = NULL;
}
- if (p->state == PS_WAITS4FS)
- p->waits4fs.req->caller = NULL;
+ if (p->state == PS_WAITS4FS) {
+ assert(p->reqslot);
+ p->reqslot->caller = NULL; /* transfer ownership */
+ p->reqslot = NULL;
+ } else if (p->reqslot) {
+ kfree(p->reqslot);
+ }
if (p->state == PS_WAITS4PIPE) {
struct process **iter = &p->waits4pipe.pipe->pipe.queued;