From cb7929ed884eeec4e55c311545b35c02e69ba9df Mon Sep 17 00:00:00 2001 From: Razvan Deaconescu Date: Sat, 13 May 2023 01:28:57 +0300 Subject: [PATCH] lib/vfscore: Initialize lists for stdio_vnode The VFS `struct vnode` structure has two `uk_list_head` members: `v_link` and `v_names`. These need to be initialized by a dedicated macro / function, such as `UK_LIST_HEAD_INIT`. The `stdio_vnode` variable (of type `struct vnode`) is not initializing these members (they are filled with zeros). This will cause crashes when using them. This commit fixes that by properly initializing the `v_link` and `v_names` members of the `stdio_vnode` variable. Signed-off-by: Razvan Deaconescu --- lib/vfscore/stdio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/vfscore/stdio.c b/lib/vfscore/stdio.c index b01c29e2c..c48efe3e3 100644 --- a/lib/vfscore/stdio.c +++ b/lib/vfscore/stdio.c @@ -206,6 +206,8 @@ static struct vnode stdio_vnode = { .v_op = &stdio_vnops, .v_lock = UK_MUTEX_INITIALIZER(stdio_vnode.v_lock), .v_refcnt = 1, + .v_link = UK_LIST_HEAD_INIT(stdio_vnode.v_link), + .v_names = UK_LIST_HEAD_INIT(stdio_vnode.v_names), .v_type = VCHR, }; -- 2.39.5