Skip to content

Commit

Permalink
[PATCH] Fix oops in vfs_quotaon_mount()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
jankara authored and Linus Torvalds committed Nov 28, 2005
1 parent 6aea114 commit 154f484
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/dquot.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 154f484

Please sign in to comment.