bug in smart.c; return code of smart_scan not checked, can cause success result in failure case, leading to 'dev' pointer being invalid.

This commit is contained in:
ziggurat29 2016-04-27 19:33:45 -05:00
parent ac6d2a301b
commit d3fbd86657
1 changed files with 6 additions and 1 deletions

View File

@ -5433,7 +5433,12 @@ int smart_initialize(int minor, FAR struct mtd_dev_s *mtd, FAR const char *partn
/* Do a scan of the device */
smart_scan(dev);
ret = smart_scan(dev);
if (ret < 0)
{
fdbg("smart_scan failed: %d\n", -ret);
goto errout;
}
}
#ifdef CONFIG_SMART_DEV_LOOP