提交 154f484b 编写于 作者: J Jan Kara 提交者: Linus Torvalds

[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: NJan Kara <jack@suse.cz>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6aea114a
...@@ -1513,10 +1513,16 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name, ...@@ -1513,10 +1513,16 @@ int vfs_quota_on_mount(struct super_block *sb, char *qf_name,
if (IS_ERR(dentry)) if (IS_ERR(dentry))
return PTR_ERR(dentry); return PTR_ERR(dentry);
if (!dentry->d_inode) {
error = -ENOENT;
goto out;
}
error = security_quota_on(dentry); error = security_quota_on(dentry);
if (!error) if (!error)
error = vfs_quota_on_inode(dentry->d_inode, type, format_id); error = vfs_quota_on_inode(dentry->d_inode, type, format_id);
out:
dput(dentry); dput(dentry);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册