Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mtd: nand: sunxi: fix potential divide-by-zero error
clk_round_rate() can return <= 0. Currently the value returned by clk_round_rate() is used directly for a division. This patch introduces a guard to ensure a divide-by-zero or a divide by a negative number for that matter can't happen by bugging out returning -EINVAL if clk_round_rate() returns <= 0. Fixes: 2d43457 ("mtd: nand: sunxi: fix EDO mode selection") Signed-off-by: Bryan O'Donoghue <[email protected]> Signed-off-by: Boris Brezillon <[email protected]>
- Loading branch information