staging: exfat: fix uninitialized variable ret

Currently there are error return paths in ffsReadFile that
exit via lable err_out that return and uninitialized error
return in variable ret. Fix this by initializing ret to zero.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: c48c9f7ff3 ("staging: exfat: add exfat filesystem code to staging")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Cc: Valdis Kletnieks <valdis.kletnieks@vt.edu>,
Reviewed-by: Nathan Chancellor <natechancellor@gmail.com>
Link: https://lore.kernel.org/r/20190830184644.15590-1-colin.king@canonical.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Colin Ian King 2019-08-30 19:46:44 +01:00 committed by Greg Kroah-Hartman
parent ef16b89c82
commit 076a8e2f76

View File

@ -779,7 +779,7 @@ static int ffsReadFile(struct inode *inode, struct file_id_t *fid, void *buffer,
{
s32 offset, sec_offset, clu_offset;
u32 clu;
int ret;
int ret = 0;
sector_t LogSector;
u64 oneblkread, read_bytes;
struct buffer_head *tmp_bh = NULL;