mirror of
https://github.com/torvalds/linux.git
synced 2026-03-07 23:04:33 +01:00
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>
This commit is contained in:
parent
9b323d2f47
commit
0787a93baa
1 changed files with 3 additions and 6 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue