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:
parent
ac6d2a301b
commit
d3fbd86657
@ -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 */
|
/* 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
|
#ifdef CONFIG_SMART_DEV_LOOP
|
||||||
|
Loading…
Reference in New Issue
Block a user