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:   Fri, 23 Jun 2017 15:58:40 +0100
From:   Colin King <colin.king@...onical.com>
To:     Theodore Ts'o <tytso@....edu>,
        Andreas Dilger <adilger.kernel@...ger.ca>,
        linux-ext4@...r.kernel.org
Cc:     kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH][ext4-next] ext4: ensure error return ret is zero on successful return

From: Colin Ian King <colin.king@...onical.com>

The error return ret is not set on a successful return path and
so it returns a garbage value. Ensure it is is set to zero on
a successful return.

Detected by CoverityScan, CID#1446616 ("Uninitialized scalar variable")

Fixes: 3499c0fb822d ("quota: add get_inode_usage callback to transfer multi-inode charges")

Signed-off-by: Colin Ian King <colin.king@...onical.com>
---
 fs/ext4/xattr.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index ce12c3fb7e59..f454b2709b5a 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -794,6 +794,7 @@ int ext4_get_inode_usage(struct inode *inode, qsize_t *usage)
 				ea_inode_refs++;
 	}
 	*usage = ea_inode_refs + 1;
+	ret = 0;
 out:
 	brelse(iloc.bh);
 	brelse(bh);
-- 
2.11.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ