summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2005-11-28 13:44:14 -0800
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-28 14:42:26 -0800
commit154f484b92e5c25c400f6903512c511644a49322 (patch)
tree49b2e6a4fd1cbe51f0780aa568cfa7c14bbdc1e4 /fs
parent6aea114a728db9296f42102d4885e7fb035de0a9 (diff)
downloadlinux-154f484b92e5c25c400f6903512c511644a49322.tar.gz
linux-154f484b92e5c25c400f6903512c511644a49322.tar.bz2
linux-154f484b92e5c25c400f6903512c511644a49322.zip
[PATCH] Fix oops in vfs_quotaon_mount()
When quota file specified in mount options did not exist, we tried to dereference NULL pointer later. Fix it. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/dquot.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/dquot.c b/fs/dquot.c
index 05b60283c9c2..2a62b3dc20ec 100644
--- a/fs/dquot.c
+++ b/fs/dquot.c
@@ -1513,10 +1513,16 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
if (IS_ERR(dentry))
return PTR_ERR(dentry);
+ if (!dentry->d_inode) {
+ error = -ENOENT;
+ goto out;
+ }
+
error = security_quota_on(dentry);
if (!error)
error = vfs_quota_on_inode(dentry->d_inode, type, format_id);
+out:
dput(dentry);
return error;
}