diff options
author | Mikhail Arkhipov <m.arhipov@rosa.ru> | 2025-04-09 00:39:06 +0300 |
---|---|---|
committer | Miquel Raynal <miquel.raynal@bootlin.com> | 2025-04-29 11:05:35 +0200 |
commit | d95846350aac72303036a70c4cdc69ae314aa26d (patch) | |
tree | 08c527de77c8ab3adf82a5b7ce67e5b2f8b98443 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | 25e08bf666607f572d5b9b87b0728d126b9bdef9 (diff) |
mtd: nand: ecc-mxic: Fix use of uninitialized variable ret
If ctx->steps is zero, the loop processing ECC steps is skipped,
and the variable ret remains uninitialized. It is later checked
and returned, which leads to undefined behavior and may cause
unpredictable results in user space or kernel crashes.
This scenario can be triggered in edge cases such as misconfigured
geometry, ECC engine misuse, or if ctx->steps is not validated
after initialization.
Initialize ret to zero before the loop to ensure correct and safe
behavior regardless of the ctx->steps value.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
Fixes: 48e6633a9fa2 ("mtd: nand: mxic-ecc: Add Macronix external ECC engine support")
Signed-off-by: Mikhail Arkhipov <m.arhipov@rosa.ru>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions