Reviewed-by: Christian Brauner <brauner@xxxxxxxxxx> Signed-off-by: Al Viro <viro@xxxxxxxxxxxxxxxxxx> --- fs/namespace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/namespace.c b/fs/namespace.c index daca5e3bec38..a57598ec422a 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -3649,7 +3649,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) @@ -3659,9 +3659,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); } /* -- 2.47.2