]> www.infradead.org Git - users/hch/misc.git/commitdiff
do_move_mount_old(): use __free(path_put)
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 24 Aug 2025 18:00:12 +0000 (14:00 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 16 Sep 2025 01:26:44 +0000 (21:26 -0400)
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/namespace.c

index a97f8dc05864be6119dca4ee0d79d82cdc94fa2c..ec4e95bab73dc104a8d22c4ba4fe151e94cc1f26 100644 (file)
@@ -3643,7 +3643,7 @@ static int do_move_mount(const struct path *old_path,
 
 static int do_move_mount_old(const struct path *path, const char *old_name)
 {
-       struct path old_path;
+       struct path old_path __free(path_put) = {};
        int err;
 
        if (!old_name || !*old_name)
@@ -3653,9 +3653,7 @@ static int do_move_mount_old(const struct path *path, const char *old_name)
        if (err)
                return err;
 
-       err = do_move_mount(&old_path, path, 0);
-       path_put(&old_path);
-       return err;
+       return do_move_mount(&old_path, path, 0);
 }
 
 /*