minix_rename(): minix_delete_entry() might fail
authorAl Viro <viro@zeniv.linux.org.uk>
Fri, 20 Jan 2023 00:29:26 +0000 (19:29 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 20 Jan 2023 00:29:26 +0000 (19:29 -0500)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/minix/namei.c

index 382ead9..b99696b 100644 (file)
@@ -230,7 +230,10 @@ static int minix_rename(struct user_namespace *mnt_userns,
                        inode_inc_link_count(new_dir);
        }
 
-       minix_delete_entry(old_de, old_page);
+       err = minix_delete_entry(old_de, old_page);
+       if (err)
+               goto out_dir;
+
        mark_inode_dirty(old_inode);
 
        if (dir_de) {