From: Diego Calleja According to http://bugzilla.kernel.org/show_bug.cgi?id=5778 fs/reiserfs/file.c is missing this check. Signed-off-by: Diego Calleja Cc: Jeff Mahoney Cc: Chris Mason Signed-off-by: Andrew Morton --- fs/reiserfs/file.c | 2 ++ 1 files changed, 2 insertions(+) diff -puN fs/reiserfs/file.c~reiserfs-missing-kmalloc-failure-check fs/reiserfs/file.c --- devel/fs/reiserfs/file.c~reiserfs-missing-kmalloc-failure-check 2006-01-16 00:00:42.000000000 -0800 +++ devel-akpm/fs/reiserfs/file.c 2006-01-16 00:00:43.000000000 -0800 @@ -192,6 +192,8 @@ static int reiserfs_allocate_blocks_for_ 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. */ _