File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
tools/testing/selftests/landlock Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -113,7 +113,7 @@ static bool supports_filesystem(const char *const filesystem)
113
113
{
114
114
char str [32 ];
115
115
int len ;
116
- bool res ;
116
+ bool res = true ;
117
117
FILE * const inf = fopen ("/proc/filesystems" , "r" );
118
118
119
119
/*
@@ -125,14 +125,16 @@ static bool supports_filesystem(const char *const filesystem)
125
125
126
126
/* filesystem can be null for bind mounts. */
127
127
if (!filesystem )
128
- return true ;
128
+ goto out ;
129
129
130
130
len = snprintf (str , sizeof (str ), "nodev\t%s\n" , filesystem );
131
131
if (len >= sizeof (str ))
132
132
/* Ignores too-long filesystem names. */
133
- return true ;
133
+ goto out ;
134
134
135
135
res = fgrep (inf , str );
136
+
137
+ out :
136
138
fclose (inf );
137
139
return res ;
138
140
}
You can’t perform that action at this time.
0 commit comments