lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 26 Feb 2018 17:45:12 +0800
From:   Chengguang Xu <cgxu519@...oud.com>
To:     jack@...e.cz
Cc:     linux-ext4@...r.kernel.org, Chengguang Xu <cgxu519@...oud.com>
Subject: [PATCH] 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@...oud.com>
---
 fs/ext2/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 1dd62ed..15f26d2 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -756,14 +756,13 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	unsigned long logic_sb_block;
 	unsigned long offset = 0;
 	unsigned long def_mount_opts;
-	long ret = -EINVAL;
+	long ret = -ENOMEM;
 	int blocksize = BLOCK_SIZE;
 	int db_count;
 	int i, j;
 	__le32 features;
 	int err;
 
-	err = -ENOMEM;
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
 		goto failed_unlock;
@@ -778,6 +777,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
 	sbi->s_sb_block = sb_block;
 
 	spin_lock_init(&sbi->s_lock);
+	ret = -EINVAL;
 
 	/*
 	 * See what the current blocksize for the device is, and
-- 
1.8.3.1

Powered by blists - more mailing lists