[PATCH][ext4-next] ext4: ensure error return ret is zero on successful return

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Colin Ian King <colin.king@xxxxxxxxxxxxx>

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@xxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux