From: Jan Kara Date: Mon, 28 Nov 2005 21:44:14 +0000 (-0800) Subject: [PATCH] Fix oops in vfs_quotaon_mount() X-Git-Tag: upstream/snapshot3+hdmi~44394^2~37 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=154f484b92e5c25c400f6903512c511644a49322;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git [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 Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/dquot.c b/fs/dquot.c index 05b6028..2a62b3d 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; }