Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

do_mount(): use __free(path_put)

Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro fc9d5efc 43d672db

+2 -4
+2 -4
fs/namespace.c
··· 4092 4092 int do_mount(const char *dev_name, const char __user *dir_name, 4093 4093 const char *type_page, unsigned long flags, void *data_page) 4094 4094 { 4095 - struct path path; 4095 + struct path path __free(path_put) = {}; 4096 4096 int ret; 4097 4097 4098 4098 ret = user_path_at(AT_FDCWD, dir_name, LOOKUP_FOLLOW, &path); 4099 4099 if (ret) 4100 4100 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); 4104 4102 } 4105 4103 4106 4104 static struct ucounts *inc_mnt_namespaces(struct user_namespace *ns)