In mxs_nand_init_ctrl there are a couple of error paths that do not set
err which could lead to the errors being silently ignored despite the
function not completing. Rather than just using if to detect these
errors use err to collect the error return value from the called
functions.
This issue was found by Smatch.
Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org>
Reviewed-by: Michael Trimarchi <michael@amarulasolutions.com>
nand->setup_data_interface = mxs_nand_setup_interface;
/* first scan to find the device and get the page size */
- if (nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_DEVICE, NULL))
+ err = nand_scan_ident(mtd, CONFIG_SYS_MAX_NAND_DEVICE, NULL);
+ if (err)
goto err_free_buffers;
- if (mxs_nand_setup_ecc(mtd))
+ err = mxs_nand_setup_ecc(mtd);
+ if (err)
goto err_free_buffers;
nand->ecc.read_page = mxs_nand_ecc_read_page;