Re: [PATCH] mtd: cqspi: Fix division by zero

2021-10-04 Thread Tom Rini
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

Re: [PATCH] mtd: cqspi: Fix division by zero

2021-09-14 Thread Marek Vasut
On 9/14/21 7:46 PM, Pratyush Yadav wrote: On 14/09/21 05:21AM, 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

Re: [PATCH] mtd: cqspi: Fix division by zero

2021-09-14 Thread Pratyush Yadav
On 14/09/21 05:21AM, 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 su

[PATCH] mtd: cqspi: Fix division by zero

2021-09-13 Thread Marek Vasut
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-qs