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>
This commit is contained in:
parent
b72e632c6c
commit
d090990510
|
@ -827,7 +827,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
unsigned long logic_sb_block;
|
unsigned long logic_sb_block;
|
||||||
unsigned long offset = 0;
|
unsigned long offset = 0;
|
||||||
unsigned long def_mount_opts;
|
unsigned long def_mount_opts;
|
||||||
long ret = -EINVAL;
|
long ret = -ENOMEM;
|
||||||
int blocksize = BLOCK_SIZE;
|
int blocksize = BLOCK_SIZE;
|
||||||
int db_count;
|
int db_count;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
@ -835,7 +835,6 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
int err;
|
int err;
|
||||||
struct ext2_mount_options opts;
|
struct ext2_mount_options opts;
|
||||||
|
|
||||||
err = -ENOMEM;
|
|
||||||
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
|
sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
|
||||||
if (!sbi)
|
if (!sbi)
|
||||||
goto failed;
|
goto failed;
|
||||||
|
@ -851,6 +850,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
sbi->s_daxdev = dax_dev;
|
sbi->s_daxdev = dax_dev;
|
||||||
|
|
||||||
spin_lock_init(&sbi->s_lock);
|
spin_lock_init(&sbi->s_lock);
|
||||||
|
ret = -EINVAL;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* See what the current blocksize for the device is, and
|
* See what the current blocksize for the device is, and
|
||||||
|
|
Loading…
Reference in New Issue