Mikhail Kshevetskiy
c3c758c20d
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 <mikhail.kshevetskiy@iopsys.eu>
2025-11-18 20:07:41 +01:00
..
2025-03-12 10:24:58 -06:00
2025-04-17 07:51:36 -06:00
2025-10-28 12:53:58 -06:00
2024-05-20 13:35:03 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2025-08-13 12:59:02 +03:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2021-02-02 15:33:42 -05:00
2024-10-09 14:52:44 -06:00
2025-10-09 09:07:03 +02:00
2025-10-28 10:27:40 -06:00
2025-10-28 10:33:00 -06:00
2025-10-20 08:28:00 -06:00
2024-10-09 09:01:54 -06:00
2024-05-02 00:01:18 +08:00
2024-10-09 09:02:22 -06:00
2024-10-11 11:44:48 -06:00
2025-09-03 19:32:38 +09:00
2025-08-27 15:53:25 +08:00
2024-10-09 09:01:54 -06:00
2025-04-25 08:52:59 -03:00
2024-10-09 09:01:54 -06:00
2025-10-28 10:33:00 -06:00
2021-01-05 12:24:41 -07:00
2024-05-20 13:35:03 -06:00
2025-10-28 12:52:56 -06:00
2024-05-20 13:35:03 -06:00
2025-09-18 17:20:39 +02:00
2024-01-29 22:35:02 -05:00
2024-05-20 13:35:03 -06:00
2025-07-17 14:37:36 +08:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2021-01-24 21:39:26 +01:00
2024-05-20 13:35:03 -06:00
2024-05-20 13:35:03 -06:00
2024-05-20 13:35:03 -06:00
2025-01-23 12:11:49 -06:00
2024-05-20 13:35:03 -06:00
2024-12-23 08:08:34 -03:00
2024-05-20 13:35:03 -06:00
2025-10-28 10:33:00 -06:00
2024-05-20 13:35:03 -06:00
2025-10-28 10:33:00 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-05-20 13:35:03 -06:00
2024-12-11 08:36:24 +01:00
2024-10-09 09:01:54 -06:00
2018-05-07 09:34:12 -04:00
2025-11-02 12:14:09 -06:00
2024-05-20 13:35:03 -06:00
2024-05-20 13:35:03 -06:00
2025-02-14 17:12:49 -06:00
2024-10-09 09:01:54 -06:00
2024-05-20 13:35:03 -06:00
2023-11-20 09:19:50 -05:00
2025-11-18 20:07:41 +01:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2025-10-28 10:33:00 -06:00
2024-05-20 13:35:03 -06:00
2025-09-18 17:20:39 +02:00
2024-10-09 09:01:54 -06:00
2024-10-09 09:01:54 -06:00
2024-05-20 13:35:03 -06:00
2025-04-12 09:42:35 +03:00
2024-05-20 13:35:03 -06:00
2024-05-20 13:35:03 -06:00
2020-12-13 16:51:09 -07:00
2024-10-09 09:01:54 -06:00
2024-05-20 13:35:03 -06:00
2024-10-09 09:01:54 -06:00
2024-11-10 20:21:07 -06:00
2024-10-09 09:01:54 -06:00
2025-01-14 08:33:31 +01:00