summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordzwdz2022-07-27 21:18:26 +0200
committerdzwdz2022-07-27 21:18:26 +0200
commit004a6fcd1a7d40564310c8348813d12ac0ea9de9 (patch)
tree0dac975088519c6fc8b012fad28910f1c9529e52
parentb9881689dd80c54bc65a76c252e78ddad503e3ea (diff)
kernel/vfs: fix assert failure when creating a vfsreq to a dead mount
-rw-r--r--src/kernel/vfs/request.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/kernel/vfs/request.c b/src/kernel/vfs/request.c
index 377cb2c..83a104f 100644
--- a/src/kernel/vfs/request.c
+++ b/src/kernel/vfs/request.c
@@ -20,8 +20,10 @@ void vfsreq_create(struct vfs_request req_) {
req->caller->waits4fs.req = req;
}
- if (!req->backend || !req->backend->potential_handlers)
+ if (!req->backend || !req->backend->potential_handlers) {
vfsreq_finish_short(req, -1);
+ return;
+ }
struct vfs_request **iter = &req->backend->queue;
while (*iter != NULL) // find free spot in queue
@@ -74,7 +76,9 @@ void vfsreq_finish(struct vfs_request *req, char __user *stored, long ret,
process_transition(req->caller, PS_RUNNING);
}
- vfs_backend_refdown(req->backend);
+ if (req->backend)
+ vfs_backend_refdown(req->backend);
+
kfree(req);
return;
}