aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYe Li2020-08-02 22:59:43 -0700
committerStefano Babic2021-01-23 11:30:31 +0100
commit983f5e03919ff10118a6c63358fed29d17497f0a (patch)
tree2a6d676e756dd91dda01c63e47893dfc68ed049a /arch
parentf637c40dd7ec664cc911a84282ab3d1ee925f6eb (diff)
imx: nandbcb: Fix potential overflow in fill_dbbt_data
Fix Coverity Issue 9006658. In fill_dbbt_data, 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')
-rw-r--r--arch/arm/mach-imx/cmd_nandbcb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/mach-imx/cmd_nandbcb.c b/arch/arm/mach-imx/cmd_nandbcb.c
index 836981c8957..ea4e147da87 100644
--- a/arch/arm/mach-imx/cmd_nandbcb.c
+++ b/arch/arm/mach-imx/cmd_nandbcb.c
@@ -476,7 +476,7 @@ static int fill_dbbt_data(struct mtd_info *mtd, void *buf, int num_blocks)
u32 *n_bad_blocksp = buf + 0x4;
for (n = 0; n < num_blocks; n++) {
- loff_t offset = n * mtd->erasesize;
+ loff_t offset = (loff_t)n * mtd->erasesize;
if (mtd_block_isbad(mtd, offset)) {
n_bad_blocks++;
*bb = n;