Commit 7d751914 authored by Kangjie Lu's avatar Kangjie Lu Committed by Greg Kroah-Hartman

net: (cpts) fix a missing check of clk_prepare

[ Upstream commit 2d822f2d ]

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>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 48b140f5
......@@ -572,7 +572,9 @@ struct cpts *cpts_create(struct device *dev, void __iomem *regs,
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.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