From: Alexander Nyberg <alexn@dsv.su.se>

There's a missing failure handling check here that would possibly lead to a
null dereference later on, I'm not sure about the correct return value
however.  I haven't tried it as I'm not sure how to trigger the case ;)

Found by the Coverity tool.

Signed-off-by: Alexander Nyberg <alexn@dsv.su.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 25-akpm/fs/ext3/ialloc.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -puN fs/ext3/ialloc.c~ext3_new_inode-failure-handling-missing-check fs/ext3/ialloc.c
--- 25/fs/ext3/ialloc.c~ext3_new_inode-failure-handling-missing-check	2005-02-28 14:50:24.000000000 -0800
+++ 25-akpm/fs/ext3/ialloc.c	2005-02-28 14:50:24.000000000 -0800
@@ -460,9 +460,12 @@ struct inode *ext3_new_inode(handle_t *h
 		goto out;
 
 	for (i = 0; i < sbi->s_groups_count; i++) {
+		err = -EIO;
+
 		gdp = ext3_get_group_desc(sb, group, &bh2);
+		if (!gdp)
+			goto fail;
 
-		err = -EIO;
 		brelse(bitmap_bh);
 		bitmap_bh = read_inode_bitmap(sb, group);
 		if (!bitmap_bh)
_