Message ID | 20170623145840.26779-1-colin.king@canonical.com |
---|---|
State | New, archived |
Headers | show |
On Fri, Jun 23, 2017 at 7:58 AM, Colin King <colin.king@canonical.com> wrote: > 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. Thanks for catching this bug! Reviewed-by: Tahsin Erdogan <tahsin@google.com>
On Fri, Jun 23, 2017 at 03:58:40PM +0100, Colin King wrote: > From: Colin Ian King <colin.king@canonical.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@canonical.com> Thanks, I've folded this into the "quota: add get_inode_usage callback to transfer multi-inode charges" with credit for your providing the fix. - Ted
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);