Home
last modified time | relevance | path

Searched hist:"791 eccd94965a8029ae09c5530bcb9a76794e408" (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/mtd/nand/raw/
H A Dsunxi_nand.c791eccd94965a8029ae09c5530bcb9a76794e408 Fri Jul 28 13:22:57 UTC 2017 Bryan O'Donoghue <pure.logic@nexus-software.ie> 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: 2d43457f79e4 ("mtd: nand: sunxi: fix EDO mode selection")
Signed-off-by: Bryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>