Skip to content

Commit 5954ecd

Browse files
committed
sys/fs: fix fs_fopen return null check
Not very likely to happen (since errno must be zero) but fixes clang-analyze warnings
1 parent a6825bd commit 5954ecd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/sys/fs.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ int fs_fread(struct mbuf **mbp, const char *path)
270270
return EINVAL;
271271

272272
err = fs_fopen(&f, path, "r");
273-
if (err) {
273+
if (err || !f) {
274274
DEBUG_WARNING("Could not open file '%s'\n", path);
275275
return err;
276276
}

0 commit comments

Comments
 (0)