mtd/smart: Fix use of uninitialized variable
This commit is contained in:
parent
14c233a2f5
commit
c7fcdf968d
@ -1368,7 +1368,8 @@ static int smart_add_sector_to_cache(FAR struct smart_struct_s *dev,
|
||||
index = 1;
|
||||
if (dev->cache_entries < CONFIG_MTD_SMART_SECTOR_CACHE_SIZE)
|
||||
{
|
||||
index = dev->cache_entries++;
|
||||
oldest = 0;
|
||||
index = dev->cache_entries++;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1387,7 +1388,7 @@ static int smart_add_sector_to_cache(FAR struct smart_struct_s *dev,
|
||||
if (dev->sCache[x].birth < oldest)
|
||||
{
|
||||
oldest = dev->sCache[x].birth;
|
||||
index = x;
|
||||
index = x;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user