diff options
| author | Mikhail Kshevetskiy <[email protected]> | 2025-11-01 09:24:24 +0300 |
|---|---|---|
| committer | Michael Trimarchi <[email protected]> | 2025-11-18 20:07:41 +0100 |
| commit | c3c758c20d3560639bfad6ac367f1a13278d67ca (patch) | |
| tree | 5d38793f4b6c403d19caf416a5c0eb7b08791484 /doc/develop/python_cq.rst | |
| parent | c675162bcb32360a45fee7a9ba9588241916549b (diff) | |
spi: spi-mem: fix coverity report CID 537478
Coverity finds a potential integer overflow in the following code:
ncycles += ((op->data.nbytes * 8) / op->data.buswidth) / (op->data.dtr ? 2 : 1);
A quick analysis shows that the only caller of the suspicious code is the
spinand_select_op_variant() function from the drivers/mtd/nand/spi/core.c
file.
According to the code the value of op->data.nbytes is equal to
nanddev_per_page_oobsize(nand) + nanddev_page_size(nand)
Therefore it's maximum value a bit larger than 4Kb (I never seen flashes
with page size large than 4Kb). So op->data.nbytes always fits within
13 bits. As result an overflow will never happen.
Anyway it's better fix an issue to eliminate the error message.
Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Diffstat (limited to 'doc/develop/python_cq.rst')
0 files changed, 0 insertions, 0 deletions
