mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
mtd/smart: Fix use of uninitialized variable
This commit is contained in:
committed by
Gregory Nutt
parent
14c233a2f5
commit
c7fcdf968d
+3
-2
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user