Skip to content

Commit 9ab2a6c

Browse files
Miklos Szeredigregkh
authored andcommitted
vfs: fix double put after complete_walk()
commit 097b180 upstream. complete_walk() already puts nd->path, no need to do it again at cleanup time. This would result in Oopses if triggered, apparently the codepath is not too well exercised. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent ebccbea commit 9ab2a6c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2238,7 +2238,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path,
22382238
/* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */
22392239
error = complete_walk(nd);
22402240
if (error)
2241-
goto exit;
2241+
return ERR_PTR(error);
22422242
error = -EISDIR;
22432243
if (S_ISDIR(nd->inode->i_mode))
22442244
goto exit;

0 commit comments

Comments
 (0)