>From 91c77c4f066a9b905538bbeb1da46dc47c44855c Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Mon, 16 May 2011 10:49:39 +0200 Subject: [PATCH] ext4: Fix oops in ext4_quota_off() When quota is not enabled when ext4_quota_off() is called, we must not dereference quota file inode since it is NULL. Check properly for this. Debugged-by: Amir Goldstein Signed-off-by: Jan Kara --- fs/ext4/super.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a86e693..2a4a9b2 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -4652,6 +4652,8 @@ static int ext4_quota_off(struct super_block *sb, int type) if (test_opt(sb, DELALLOC)) sync_filesystem(sb); + if (!inode) + goto out; /* Update modification times of quota files when userspace can * start looking at them */ handle = ext4_journal_start(inode, 1); -- 1.7.1