diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-04-01 00:22:26 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2008-04-01 00:22:26 -0400 |
commit | 399f486286f44d55c4fff0e9cc5d712f2b443489 (patch) | |
tree | 0c2820b3e04232eaa96f08c1057b87728fb3e7a4 /fs/open.c | |
parent | 481419ec9fbdf3f4ec5389c7e91a81b4a7ebee8d (diff) | |
parent | a9edadbf790d72adf6ebed476cb5caf7743e7e4a (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6 into for-linus
Diffstat (limited to 'fs/open.c')
-rw-r--r-- | fs/open.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -903,6 +903,18 @@ struct file *dentry_open(struct dentry *dentry, struct vfsmount *mnt, int flags) | |||
903 | int error; | 903 | int error; |
904 | struct file *f; | 904 | struct file *f; |
905 | 905 | ||
906 | /* | ||
907 | * We must always pass in a valid mount pointer. Historically | ||
908 | * callers got away with not passing it, but we must enforce this at | ||
909 | * the earliest possible point now to avoid strange problems deep in the | ||
910 | * filesystem stack. | ||
911 | */ | ||
912 | if (!mnt) { | ||
913 | printk(KERN_WARNING "%s called with NULL vfsmount\n", __func__); | ||
914 | dump_stack(); | ||
915 | return ERR_PTR(-EINVAL); | ||
916 | } | ||
917 | |||
906 | error = -ENFILE; | 918 | error = -ENFILE; |
907 | f = get_empty_filp(); | 919 | f = get_empty_filp(); |
908 | if (f == NULL) { | 920 | if (f == NULL) { |