Message ID | 20180131084918.15267-1-ebiggers3@gmail.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, Jan 31, 2018 at 12:49 AM, Eric Biggers <ebiggers3@gmail.com> wrote: > > If devpts_ptmx_path() returns an error code, then devpts_mntget() > dereferences an ERR_PTR(): Thanks, applied. Linus
diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 7eae33ffa3fcc..e31d6ed3ec327 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -168,11 +168,11 @@ struct vfsmount *devpts_mntget(struct file *filp, struct pts_fs_info *fsi) dput(path.dentry); if (err) { mntput(path.mnt); - path.mnt = ERR_PTR(err); + return ERR_PTR(err); } if (DEVPTS_SB(path.mnt->mnt_sb) != fsi) { mntput(path.mnt); - path.mnt = ERR_PTR(-ENODEV); + return ERR_PTR(-ENODEV); } return path.mnt; }