diff options
author | Denis Arefev <arefev@swemel.ru> | 2023-08-24 16:02:15 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2023-09-11 17:50:42 +0200 |
commit | 8ffd18a6744b18ff9b58abf7261aaccd78be98cf (patch) | |
tree | d5f78fcf5371e1dac1979dd8c663d156b21a4692 /drivers/mtd/lpddr | |
parent | 0bb80ecc33a8fb5a682236443c1e740d5c917d1d (diff) | |
download | linux-8ffd18a6744b18ff9b58abf7261aaccd78be98cf.tar.gz linux-8ffd18a6744b18ff9b58abf7261aaccd78be98cf.tar.bz2 linux-8ffd18a6744b18ff9b58abf7261aaccd78be98cf.zip |
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
Diffstat (limited to 'drivers/mtd/lpddr')
-rw-r--r-- | drivers/mtd/lpddr/lpddr_cmds.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/lpddr/lpddr_cmds.c b/drivers/mtd/lpddr/lpddr_cmds.c index 3c3939bc2dad..14e36ae71958 100644 --- a/drivers/mtd/lpddr/lpddr_cmds.c +++ b/drivers/mtd/lpddr/lpddr_cmds.c @@ -61,7 +61,7 @@ struct mtd_info *lpddr_cmdset(struct map_info *map) mtd->_point = lpddr_point; mtd->_unpoint = lpddr_unpoint; } - mtd->size = 1 << lpddr->qinfo->DevSizeShift; + mtd->size = 1ULL << lpddr->qinfo->DevSizeShift; mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; mtd->writesize = 1 << lpddr->qinfo->BufSizeShift; |