From 004a6fcd1a7d40564310c8348813d12ac0ea9de9 Mon Sep 17 00:00:00 2001 From: dzwdz Date: Wed, 27 Jul 2022 21:18:26 +0200 Subject: kernel/vfs: fix assert failure when creating a vfsreq to a dead mount --- src/kernel/vfs/request.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/kernel/vfs/request.c') 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; } -- cgit v1.2.3