Re: [PATCH] mtd: nand: sunxi: fix potential divide-by-zero error

2017-07-31 Thread Boris Brezillon
On Fri, 28 Jul 2017 14:22:57 +0100 Bryan O'Donoghue wrote: > 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 ha

[PATCH] mtd: nand: sunxi: fix potential divide-by-zero error

2017-07-28 Thread Bryan O'Donoghue
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 <=