diff options
author | Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> | 2011-01-19 07:08:41 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-03-21 01:10:41 -0400 |
commit | c212f9aaf9101a037fb7f59e75e639437e11d758 (patch) | |
tree | da00b3e84fa5ffc7648c14593aaf1cbb4931c229 /fs/open.c | |
parent | aa597bc1f9476d0527e35d6dd9b481422e8205a0 (diff) |
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>
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 13 |
1 files changed, 2 insertions, 11 deletions
@@ -835,17 +835,8 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags, | |||
835 | 835 | ||
836 | validate_creds(cred); | 836 | validate_creds(cred); |
837 | 837 | ||
838 | /* | 838 | /* We must always pass in a valid mount pointer. */ |
839 | * We must always pass in a valid mount pointer. Historically | 839 | BUG_ON(!mnt); |
840 | * callers got away with not passing it, but we must enforce this at | ||
841 | * the earliest possible point now to avoid strange problems deep in the | ||
842 | * filesystem stack. | ||
843 | */ | ||
844 | if (!mnt) { | ||
845 | printk(KERN_WARNING "%s called with NULL vfsmount\n", __func__); | ||
846 | dump_stack(); | ||
847 | return ERR_PTR(-EINVAL); | ||
848 | } | ||
849 | 840 | ||
850 | error = -ENFILE; | 841 | error = -ENFILE; |
851 | f = get_empty_filp(); | 842 | f = get_empty_filp(); |