Commit 2d822f2d authored by Kangjie Lu's avatar Kangjie Lu Committed by David S. Miller

net: (cpts) fix a missing check of clk_prepare

clk_prepare() could fail, so let's check its status, and if it fails,
return its error code upstream.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 26fd962b
...@@ -590,7 +590,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs, ...@@ -590,7 +590,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
return ERR_CAST(cpts->refclk); return ERR_CAST(cpts->refclk);
} }
clk_prepare(cpts->refclk); ret = clk_prepare(cpts->refclk);
if (ret)
return ERR_PTR(ret);
cpts->cc.read = cpts_systim_read; cpts->cc.read = cpts_systim_read;
cpts->cc.mask = CLOCKSOURCE_MASK(32); cpts->cc.mask = CLOCKSOURCE_MASK(32);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment