Skip to contentSkip to conversation

reiserfs missing kmalloc failure check

PATCH New Diego Calleja 1 participant 1 message Jan 16, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reiserfs missing kmalloc failure check

According to http://bugzilla.kernel.org/show_bug.cgi?id=5778
fs/reiserfs/file.c is missing this check?

fs/reiserfs/file.c +2 -0
Index: test/fs/reiserfs/file.c
===================================================================
@@ -192,6 +192,8 @@
 
 	allocated_blocks = kmalloc((blocks_to_allocate + will_prealloc) *
 				   sizeof(b_blocknr_t), GFP_NOFS);
+	if (!allocated_blocks)
+		return -ENOMEM;
 
 	/* First we compose a key to point at the writing position, we want to do
 	   that outside of any locking region. */