[PATCH] mtd: cqspi: Fix division by zero

Tom Rini trini at konsulko.com
Mon Oct 4 15:28:27 CEST 2021

On Tue, Sep 14, 2021 at 05:21:48AM +0200, Marek Vasut wrote:

> 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 at denx.de>
> Cc: Jagan Teki <jagan at amarulasolutions.com>
> Cc: Vignesh R <vigneshr at ti.com>
> Cc: Pratyush Yadav <p.yadav at ti.com>

Applied to u-boot/master, thanks!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20211004/323087e6/attachment.sig>

More information about the U-Boot mailing list