mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-12 02:40:53 +00:00
fs: Use BUG_ON(!mnt) at dentry_open().
dentry_open() requires callers to pass a valid vfsmount. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
aa597bc1f9
commit
c212f9aaf9
13
fs/open.c
13
fs/open.c
@ -835,17 +835,8 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags,
|
||||
|
||||
validate_creds(cred);
|
||||
|
||||
/*
|
||||
* We must always pass in a valid mount pointer. Historically
|
||||
* callers got away with not passing it, but we must enforce this at
|
||||
* the earliest possible point now to avoid strange problems deep in the
|
||||
* filesystem stack.
|
||||
*/
|
||||
if (!mnt) {
|
||||
printk(KERN_WARNING "%s called with NULL vfsmount\n", __func__);
|
||||
dump_stack();
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
/* We must always pass in a valid mount pointer. */
|
||||
BUG_ON(!mnt);
|
||||
|
||||
error = -ENFILE;
|
||||
f = get_empty_filp();
|
||||
|
Loading…
Reference in New Issue
Block a user