diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2025-12-14 03:32:45 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2026-01-16 12:52:04 -0500 |
| commit | 0787a93baa1aab9fd0cb8500105d11d3d3a58f7a (patch) | |
| tree | 70693e1f02cec536f8ab1445c1d54968b22ba70f /fs/filesystems.c | |
| parent | 9b323d2f474071cc6c627f73af301ba6f5e2b83f (diff) | |
sysfs(2): fs_index() argument is _not_ a pathname
... it's a filesystem type name.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/filesystems.c')
| -rw-r--r-- | fs/filesystems.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/filesystems.c b/fs/filesystems.c index 95e5256821a5..0c7d2b7ac26c 100644 --- a/fs/filesystems.c +++ b/fs/filesystems.c @@ -132,24 +132,21 @@ EXPORT_SYMBOL(unregister_filesystem); static int fs_index(const char __user * __name) { struct file_system_type * tmp; - struct filename *name; + char *name __free(kfree) = strndup_user(__name, PATH_MAX); int err, index; - name = getname(__name); - err = PTR_ERR(name); if (IS_ERR(name)) - return err; + return PTR_ERR(name); err = -EINVAL; read_lock(&file_systems_lock); for (tmp=file_systems, index=0 ; tmp ; tmp=tmp->next, index++) { - if (strcmp(tmp->name, name->name) == 0) { + if (strcmp(tmp->name, name) == 0) { err = index; break; } } read_unlock(&file_systems_lock); - putname(name); return err; } |
