From 6597dec6a8874d4685c7956541491f7f6d949139 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Fri, 20 Dec 2024 14:33:51 +0100 Subject: [PATCH] sys/fs: fix fs_fopen return null check Not very likely to happen (since errno must be zero) but fixes clang-analyze warnings --- src/sys/fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sys/fs.c b/src/sys/fs.c index d31aa7c7e..4dc133c4d 100644 --- a/src/sys/fs.c +++ b/src/sys/fs.c @@ -270,7 +270,7 @@ int fs_fread(struct mbuf **mbp, const char *path) return EINVAL; err = fs_fopen(&f, path, "r"); - if (err) { + if (err || !f) { DEBUG_WARNING("Could not open file '%s'\n", path); return err; }