Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

authored by

Denis Arefev and committed by
Miquel Raynal
8ffd18a6 0bb80ecc

+1 -1
+1 -1
drivers/mtd/lpddr/lpddr_cmds.c
··· 61 61 mtd->_point = lpddr_point; 62 62 mtd->_unpoint = lpddr_unpoint; 63 63 } 64 - mtd->size = 1 << lpddr->qinfo->DevSizeShift; 64 + mtd->size = 1ULL << lpddr->qinfo->DevSizeShift; 65 65 mtd->erasesize = 1 << lpddr->qinfo->UniformBlockSizeShift; 66 66 mtd->writesize = 1 << lpddr->qinfo->BufSizeShift; 67 67