From: Josef Bacik Date: Wed, 30 Apr 2008 02:04:56 +0000 (-0400) Subject: ext4: check return of ext4_orphan_get properly X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=97bd42b9c8be748ad85b362ba3bd401f4d35be80;p=linux-2.6 ext4: check return of ext4_orphan_get properly This patch fix a panic while running fsfuzzer. We are improperly checking the return of ext4_orphan_get. Signed-off-by: Josef Bacik Signed-off-by: Mingming Cao Signed-off-by: "Theodore Ts'o" --- diff --git a/fs/ext4/super.c b/fs/ext4/super.c index c81a8e759b..425f42778e 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -1594,8 +1594,8 @@ static void ext4_orphan_cleanup (struct super_block * sb, while (es->s_last_orphan) { struct inode *inode; - if (!(inode = - ext4_orphan_get(sb, le32_to_cpu(es->s_last_orphan)))) { + inode = ext4_orphan_get(sb, le32_to_cpu(es->s_last_orphan)); + if (IS_ERR(inode)) { es->s_last_orphan = 0; break; }