[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>

authored by

Jan Kara and committed by
Linus Torvalds
154f484b 6aea114a

+6
+6
fs/dquot.c
··· 1513 1513 if (IS_ERR(dentry)) 1514 1514 return PTR_ERR(dentry); 1515 1515 1516 + if (!dentry->d_inode) { 1517 + error = -ENOENT; 1518 + goto out; 1519 + } 1520 + 1516 1521 error = security_quota_on(dentry); 1517 1522 if (!error) 1518 1523 error = vfs_quota_on_inode(dentry->d_inode, type, format_id); 1519 1524 1525 + out: 1520 1526 dput(dentry); 1521 1527 return error; 1522 1528 }