mirror of
https://github.com/apache/nuttx.git
synced 2026-08-12 16:06:51 +00:00
mtd/smartfs: Fix uninitialized variable
If CONFIG_SMARTFS_MULTI_ROOT_DIRS is enabled and dev->partname is not empty, dev->rwbuffer is an uninitialized variable and register_blockdriver is called.
This commit is contained in:
parent
06b158a490
commit
b04c4972fe
1 changed files with 1 additions and 4 deletions
|
|
@ -2192,8 +2192,7 @@ static int smart_scan(FAR struct smart_struct_s *dev)
|
|||
{
|
||||
if (dev->partname[0] != '\0')
|
||||
{
|
||||
snprintf(dev->rwbuffer, sizeof(devname),
|
||||
"/dev/smart%d%sd%d",
|
||||
snprintf(devname, sizeof(devname), "/dev/smart%d%sd%d",
|
||||
dev->minor, dev->partname, x + 1);
|
||||
}
|
||||
else
|
||||
|
|
@ -2219,8 +2218,6 @@ static int smart_scan(FAR struct smart_struct_s *dev)
|
|||
|
||||
rootdirdev->dev = dev;
|
||||
rootdirdev->rootdirnum = x;
|
||||
ret = register_blockdriver(dev->rwbuffer, &g_bops, 0,
|
||||
rootdirdev);
|
||||
|
||||
/* Inode private data is a reference to the SMART device
|
||||
* structure.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue