Skip to content

Commit fc9d5ef

Browse files
author
Al Viro
committed
do_mount(): use __free(path_put)
Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 43d672d commit fc9d5ef

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

fs/namespace.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4092,15 +4092,13 @@ int path_mount(const char *dev_name, const struct path *path,
40924092
int do_mount(const char *dev_name, const char __user *dir_name,
40934093
const char *type_page, unsigned long flags, void *data_page)
40944094
{
4095-
struct path path;
4095+
struct path path __free(path_put) = {};
40964096
int ret;
40974097

40984098
ret = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path);
40994099
if (ret)
41004100
return ret;
4101-
ret = path_mount(dev_name, &path, type_page, flags, data_page);
4102-
path_put(&path);
4103-
return ret;
4101+
return path_mount(dev_name, &path, type_page, flags, data_page);
41044102
}
41054103

41064104
static struct ucounts *inc_mnt_namespaces(struct user_namespace *ns)

0 commit comments

Comments
 (0)