summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2005-11-28 22:44:14 +0100
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-28 23:42:26 +0100
commit154f484b92e5c25c400f6903512c511644a49322 (patch)
tree49b2e6a4fd1cbe51f0780aa568cfa7c14bbdc1e4 /fs
parent[PATCH] md: fix --re-add for raid1 and raid6 (diff)
downloadlinux-154f484b92e5c25c400f6903512c511644a49322.tar.xz
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;
}