VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   57 Tags
author: Wolfram Sang <wsa+renesas@sang-engineering.com> 2016-03-02 23:33:32 +0100 committer: David S. Miller <davem@davemloft.net> 2016-03-20 16:59:27 -0400 commit: 0d7ef45cdeebcc95d581703f45f6de7b2ee89b8d parent: eccf432f6542d9895d6c50edb5634c6147918ed2
Commit Summary:
ide: palm_bk3710: test clock rate to avoid division by 0
Diffstat:
1 file changed, 2 insertions, 0 deletions
diff --git a/drivers/ide/palm_bk3710.c b/drivers/ide/palm_bk3710.c
index 8012e43bf8f6..46427ea01753 100644
--- a/drivers/ide/palm_bk3710.c
+++ b/drivers/ide/palm_bk3710.c
@@ -325,6 +325,8 @@ static int __init palm_bk3710_probe(struct platform_device *pdev)
 
 	clk_enable(clk);
 	rate = clk_get_rate(clk);
+	if (!rate)
+		return -EINVAL;
 
 	/* NOTE:  round *down* to meet minimum timings; we count in clocks */
 	ideclk_period = 1000000000UL / rate;