4095f4d922
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 <todd.e.brandt@linux.intel.com>
Reported-by: Todd Brandt <todd.e.brandt@linux.intel.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=217448
Fixes:
|
||
---|---|---|
.. | ||
controllers | ||
Kconfig | ||
Makefile | ||
atmel.c | ||
catalyst.c | ||
core.c | ||
core.h | ||
debugfs.c | ||
eon.c | ||
esmt.c | ||
everspin.c | ||
fujitsu.c | ||
gigadevice.c | ||
intel.c | ||
issi.c | ||
macronix.c | ||
micron-st.c | ||
otp.c | ||
sfdp.c | ||
sfdp.h | ||
spansion.c | ||
sst.c | ||
swp.c | ||
sysfs.c | ||
winbond.c | ||
xilinx.c | ||
xmc.c |