summaryrefslogtreecommitdiff
path: root/arch/arm
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2020-08-03 09:07:55 +0300
committerStefano Babic <sbabic@denx.de>2021-01-23 13:30:31 +0300
commit233b0b070e2186ef01ad79188d2408e07cda08e3 (patch)
tree797eb61840f216a152fdebd519c148f57271eee6 /arch/arm
parent983f5e03919ff10118a6c63358fed29d17497f0a (diff)
downloadu-boot-233b0b070e2186ef01ad79188d2408e07cda08e3.tar.xz
imx: nandbcb: Fix potential overflow in nandbcb_set_boot_config
Fix Coverity Issue 9006656. In nandbcb_set_boot_config, an integer overflow occurs, with the result converted to a wider integer type. Signed-off-by: Ye Li <ye.li@nxp.com> Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-imx/cmd_nandbcb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index ea4e147da8..028b7c4835 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -275,7 +275,8 @@ static int nandbcb_set_boot_config(int argc, char * const argv[],
boot_stream1_address);
if (boot_cfg->secondary_boot_stream_off_in_MB)
- boot_stream2_address = boot_cfg->secondary_boot_stream_off_in_MB * 1024 * 1024;
+ boot_stream2_address =
+ (loff_t)boot_cfg->secondary_boot_stream_off_in_MB * 1024 * 1024;
max_boot_stream_size = boot_stream2_address - boot_stream1_address;