aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-08 11:34:30 -0500
committerIan Moffett <ian@osmora.org>2024-03-08 11:34:30 -0500
commit02b190f4c97758f7871d1301a68eb6a0bff2f365 (patch)
tree62393e80bd05c229f5e81f5cd7b853d672c3127f
parentd8dd7ab232cd23c38fbc5b19af6dabb903fac546 (diff)
kernel: fs: Fix logic bug in initramfs code
Return NULL if hdr is NULL, Before, if the file is not found, 0x200 would be returned instead of NULL. Signed-off-by: Ian Moffett <ian@osmora.org>
-rw-r--r--sys/fs/initramfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/fs/initramfs.c b/sys/fs/initramfs.c
index c0eaa0c..dad3763 100644
--- a/sys/fs/initramfs.c
+++ b/sys/fs/initramfs.c
@@ -221,7 +221,7 @@ initramfs_open(const char *path)
}
hdr = initramfs_from_path((void *)initramfs, path);
- return hdr_to_contents(hdr);
+ return (hdr == NULL) ? NULL : hdr_to_contents(hdr);
}
struct vfsops g_initramfs_ops = {