Skip to content

Commit 8ffd18a

Browse files
Denis Arefevmiquelraynal
authored andcommitted
mtd: lpddr_cmds: Add literal suffix
The value of an arithmetic expression 1 << lpddr->qinfo->DevSizeShift is subject to overflow due to a failure to cast operands to a larger data type before performing arithmetic Found by Linux Verification Center (linuxtesting.org) with SVACE. Signed-off-by: Denis Arefev <arefev@swemel.ru> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20230824130215.10396-1-arefev@swemel.ru
1 parent 0bb80ec commit 8ffd18a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/mtd/lpddr/lpddr_cmds.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map)
6161
mtd->_point = lpddr_point;
6262
mtd->_unpoint = lpddr_unpoint;
6363
}
64-
mtd->size = 1 << lpddr->qinfo->DevSizeShift;
64+
mtd->size = 1ULL << lpddr->qinfo->DevSizeShift;
6565
mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift;
6666
mtd->writesize = 1 << lpddr->qinfo->BufSizeShift;
6767

0 commit comments

Comments
 (0)