diff options
| author | Heinrich Schuchardt <[email protected]> | 2026-04-29 17:54:18 +0200 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2026-05-04 14:35:10 -0600 |
| commit | ba1209d7a756552677f07c207cdf7fac400a8b7c (patch) | |
| tree | 2b413660818fe2553455dd0b576d28fb587d34ee | |
| parent | 2c733e6c85576b86358885c0a9462a0337797653 (diff) | |
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 <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
| -rw-r--r-- | fs/fat/fat.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/fat/fat.c b/fs/fat/fat.c index 31c136e3b9e..c1ccf30771a 100644 --- a/fs/fat/fat.c +++ b/fs/fat/fat.c @@ -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; |
