add patch remove-NULL-check-before-kmem_cache_destroy
[ext4-patch-queue.git] / fix-wrong-return-value-in-ext4_read_inode_bitmap
blob5b2bcf03d3692e39608b8e50b33f68af80bfdd7a
1 ext4: fix wrong return value in ext4_read_inode_bitmap()
3 From: Wang Shilong <wshilong@ddn.com>
5 The only reason that sb_getblk() could fail is out of memory,
6 ext4 codes have returned -ENOMME for all other places except this
7 one, let's fix it here too.
9 Signed-off-by: Wang Shilong <wshilong@ddn.com>
10 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
11 ---
12  fs/ext4/ialloc.c | 2 +-
13  1 file changed, 1 insertion(+), 1 deletion(-)
15 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
16 index df92e3ec9913..33a2c98ce1ff 100644
17 --- a/fs/ext4/ialloc.c
18 +++ b/fs/ext4/ialloc.c
19 @@ -143,7 +143,7 @@ ext4_read_inode_bitmap(struct super_block *sb, ext4_group_t block_group)
20                 ext4_error(sb, "Cannot read inode bitmap - "
21                             "block_group = %u, inode_bitmap = %llu",
22                             block_group, bitmap_blk);
23 -               return ERR_PTR(-EIO);
24 +               return ERR_PTR(-ENOMEM);
25         }
26         if (bitmap_uptodate(bh))
27                 goto verify;
28 -- 
29 2.14.3