diff options
author | Chengguang Xu <cgxu519@icloud.com> | 2018-02-26 04:45:12 -0500 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2018-03-02 08:23:11 -0500 |
commit | d09099051057bbae5e1a887167ad6189ac8bfca4 (patch) | |
tree | 82779d25811aed48918168272ccf3c5554c88523 /fs/ext2 | |
parent | b72e632c6c7e29343651b0e26539b2e01444dfe6 (diff) |
ext2: change return code to -ENOMEM when failing memory allocation
Change return code to -ENOMEM from -EINVAL when failing memory
allocation in fill_super(), meanwhile delete redundant initial
assignment of variable err.
Signed-off-by: Chengguang Xu <cgxu519@icloud.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/ext2')
-rw-r--r-- | fs/ext2/super.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c index 7666c065b96f..de1694512f1f 100644 --- a/fs/ext2/super.c +++ b/fs/ext2/super.c | |||
@@ -827,7 +827,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
827 | unsigned long logic_sb_block; | 827 | unsigned long logic_sb_block; |
828 | unsigned long offset = 0; | 828 | unsigned long offset = 0; |
829 | unsigned long def_mount_opts; | 829 | unsigned long def_mount_opts; |
830 | long ret = -EINVAL; | 830 | long ret = -ENOMEM; |
831 | int blocksize = BLOCK_SIZE; | 831 | int blocksize = BLOCK_SIZE; |
832 | int db_count; | 832 | int db_count; |
833 | int i, j; | 833 | int i, j; |
@@ -835,7 +835,6 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
835 | int err; | 835 | int err; |
836 | struct ext2_mount_options opts; | 836 | struct ext2_mount_options opts; |
837 | 837 | ||
838 | err = -ENOMEM; | ||
839 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 838 | sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
840 | if (!sbi) | 839 | if (!sbi) |
841 | goto failed; | 840 | goto failed; |
@@ -851,6 +850,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent) | |||
851 | sbi->s_daxdev = dax_dev; | 850 | sbi->s_daxdev = dax_dev; |
852 | 851 | ||
853 | spin_lock_init(&sbi->s_lock); | 852 | spin_lock_init(&sbi->s_lock); |
853 | ret = -EINVAL; | ||
854 | 854 | ||
855 | /* | 855 | /* |
856 | * See what the current blocksize for the device is, and | 856 | * See what the current blocksize for the device is, and |