Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 791eccd9 authored by Bryan O'Donoghue's avatar Bryan O'Donoghue Committed by Boris Brezillon
Browse files

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: 2d43457f ("mtd: nand: sunxi: fix EDO mode selection")
Signed-off-by: default avatarBryan O'Donoghue <pure.logic@nexus-software.ie>
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@free-electrons.com>
parent f7f8c175
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment