diff options
author | Tudor Ambarus <[email protected]> | 2023-05-18 08:54:40 +0000 |
---|---|---|
committer | Miquel Raynal <[email protected]> | 2023-05-26 19:40:32 +0200 |
commit | 4095f4d9225a64921a6ee4bb8dbc94c6edc2df08 (patch) | |
tree | 64f9d4687393227e1ed22c38ed4e2c261f2c1850 /tools/perf/scripts/python/intel-pt-events.py | |
parent | 650a8884a364ff2568b51cde9009cfd43cdae6ad (diff) |
mtd: spi-nor: Fix divide by zero for spi-nor-generic flashes
We failed to initialize n_banks for spi-nor-generic flashes, which
caused a devide by zero when computing the bank_size.
By default we consider that all chips have a single bank. Initialize
the default number of banks for spi-nor-generic flashes. Even if the
bug is fixed with this simple initialization, check the n_banks value
before dividing so that we make sure this kind of bug won't occur again
if some other struct instance is created uninitialized.
Suggested-by: Todd Brandt <[email protected]>
Reported-by: Todd Brandt <[email protected]>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217448
Fixes: 9d6c5d64f028 ("mtd: spi-nor: Introduce the concept of bank")
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Tudor Ambarus <[email protected]>
Tested-by: Todd Brandt <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/intel-pt-events.py')
0 files changed, 0 insertions, 0 deletions