diff options
author | Marek Vasut <marex@denx.de> | 2021-09-14 05:21:48 +0200 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-10-04 08:51:14 -0400 |
commit | c2e0363571b124c4c543ad98d039d1eb319f1562 (patch) | |
tree | cbc73f184158baab21e6f5cedce971d4c28b3667 /doc | |
parent | bf9fcc20000c21e22f2da4d67c5975f586d123f5 (diff) | |
download | u-boot-c2e0363571b124c4c543ad98d039d1eb319f1562.tar.gz u-boot-c2e0363571b124c4c543ad98d039d1eb319f1562.tar.bz2 u-boot-c2e0363571b124c4c543ad98d039d1eb319f1562.zip |
mtd: cqspi: Fix division by zero
Both dummy.nbytes and dummy.buswidth may be zero. By not checking
the later, it is possible to trigger division by zero and a crash.
This does happen with tiny SPI NOR framework in SPL. Fix this by
adding the check and returning zero dummy bytes in such a case.
Fixes: 38b0852b0ea ("spi: cadence-qspi: Add support for octal DTR flashes")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: Jagan Teki <jagan@amarulasolutions.com>
Cc: Vignesh R <vigneshr@ti.com>
Cc: Pratyush Yadav <p.yadav@ti.com>
[trini: Drop Pratyush's RB as his requested changes weren't made as
Marek disagreed]
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions