From: Miklos Szeredi Date: Tue, 6 Mar 2012 12:56:33 +0000 (+0100) Subject: vfs: fix double put after complete_walk() X-Git-Tag: firefly_0821_release~7541^2~1587 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=8b5cfa43c4e9e9042c77a4683d1b747329dbb2cf;p=firefly-linux-kernel-4.4.55.git vfs: fix double put after complete_walk() commit 097b180ca09b581ef0dc24fbcfc1b227de3875df 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 Signed-off-by: Al Viro Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/namei.c b/fs/namei.c index 91188604ffec..16bda6cd602d 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2208,7 +2208,7 @@ static struct file *do_last(struct nameidata *nd, struct path *path, /* Why this, you ask? _Now_ we might have grown LOOKUP_JUMPED... */ error = complete_walk(nd); if (error) - goto exit; + return ERR_PTR(error); error = -EISDIR; if (S_ISDIR(nd->inode->i_mode)) goto exit;