mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-05-05 04:36:13 +02:00
fat: initialize ret in disk_rw()
If fat_sect_size = 0 and nr_sect = 0, the value of ret is never initialized. A random return value is returned. Initialize ret to 0. Addresses-Coverity-ID: - 645495 Uninitialized scalar variable Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
2c733e6c85
commit
ba1209d7a7
@ -71,7 +71,7 @@ static inline __u32 sect_to_block(__u32 sect, __u32 *off)
|
||||
|
||||
static int disk_rw(__u32 sect, __u32 nr_sect, void *buf, bool read)
|
||||
{
|
||||
int ret;
|
||||
int ret = 0;
|
||||
__u8 *block = NULL;
|
||||
__u32 rem, size, s, n;
|
||||
const ulong blksz = cur_part_info.blksz;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user