[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>
This commit is contained in:
parent
6aea114a72
commit
154f484b92
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue