mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
path_openat(): fix double fput()
[ Upstream commit f15133df088ecadd141ea1907f2c96df67c729f0 ] path_openat() jumps to the wrong place after do_tmpfile() - it has already done path_cleanup() (as part of path_lookupat() called by do_tmpfile()), so doing that again can lead to double fput(). Change-Id: I83bb7f0a15db8d2202a010b75ade98f80e7270f2 Cc: stable@vger.kernel.org # v3.11+ Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
This commit is contained in:
parent
83c1f7b47f
commit
9332955257
1 changed files with 2 additions and 1 deletions
|
@ -3062,7 +3062,7 @@ static struct file *path_openat(int dfd, struct filename *pathname,
|
|||
|
||||
if (unlikely(file->f_flags & __O_TMPFILE)) {
|
||||
error = do_tmpfile(dfd, pathname, nd, flags, op, file, &opened);
|
||||
goto out;
|
||||
goto out2;
|
||||
}
|
||||
|
||||
error = path_init(dfd, pathname->name, flags | LOOKUP_PARENT, nd, &base);
|
||||
|
@ -3100,6 +3100,7 @@ out:
|
|||
path_put(&nd->root);
|
||||
if (base)
|
||||
fput(base);
|
||||
out2:
|
||||
if (!(opened & FILE_OPENED)) {
|
||||
BUG_ON(!error);
|
||||
put_filp(file);
|
||||
|
|
Loading…
Reference in a new issue