mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
mtd: rawnand: stm32_fmc2: Ensure to return error code
In stm32_fmc2_nfc_probe there are 3 error returns that do not set the error code before returning which could lead to the error being silently ignored. Just return -EINVAL in each case. This issue was found by Smatch. Signed-off-by: Andrew Goodbody <andrew.goodbody@linaro.org> Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
This commit is contained in:
committed by
Michael Trimarchi
parent
42ef9a0b7f
commit
4003ed1c1e
@@ -942,21 +942,21 @@ static int stm32_fmc2_nfc_probe(struct udevice *dev)
|
||||
addr = dev_read_addr_index(dev, mem_region);
|
||||
if (addr == FDT_ADDR_T_NONE) {
|
||||
dev_err(dev, "Resource data_base not found for cs%d", chip_cs);
|
||||
return ret;
|
||||
return -EINVAL;
|
||||
}
|
||||
nfc->data_base[chip_cs] = addr;
|
||||
|
||||
addr = dev_read_addr_index(dev, mem_region + 1);
|
||||
if (addr == FDT_ADDR_T_NONE) {
|
||||
dev_err(dev, "Resource cmd_base not found for cs%d", chip_cs);
|
||||
return ret;
|
||||
return -EINVAL;
|
||||
}
|
||||
nfc->cmd_base[chip_cs] = addr;
|
||||
|
||||
addr = dev_read_addr_index(dev, mem_region + 2);
|
||||
if (addr == FDT_ADDR_T_NONE) {
|
||||
dev_err(dev, "Resource addr_base not found for cs%d", chip_cs);
|
||||
return ret;
|
||||
return -EINVAL;
|
||||
}
|
||||
nfc->addr_base[chip_cs] = addr;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user