quota: Fix possible oops in __dquot_initialize()
authorJan Kara <jack@suse.cz>
Mon, 18 Oct 2010 22:24:21 +0000 (00:24 +0200)
committerJan Kara <jack@suse.cz>
Wed, 27 Oct 2010 23:30:06 +0000 (01:30 +0200)
commit4408ea41c0ab4b711d4da44dd954fb06dce6c3f8
tree7244e8448303b034e17ab24a835012ae99b33734
parenta4c18ad2eed93194a667cb9f6662c3b3e8f0bba9
quota: Fix possible oops in __dquot_initialize()

When quotaon(8) races with __dquot_initialize() or dqget() fails because
of EIO, ENOSPC, or similar error, we could possibly dereference NULL pointer
in inode->i_dquot[cnt]. Add proper checking.

Reported-by: Dmitry Monakhov <dmonakhov@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/quota/dquot.c