This patch fixes coverity issue of "divide by 0".
Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
Reviewed-by: Bai Ping <ping.bai@nxp.com>
Signed-off-by: Arulpandiyan Vadivel <arulpandiyan_vadivel@mentor.com>
int i;
u32 val, ipg_rate = clk_get_rate(ipg_clk);
+ if (ipg_rate == 0) {
+ WARN_ON(1);
+ return;
+ }
+
/* Enable reset clocks for all devices in the domain */
for (i = 0; i < pd->num_clks; i++)
clk_prepare_enable(pd->clk[i]);
u32 ipg_rate = clk_get_rate(ipg_clk);
int i;
+ if (ipg_rate == 0) {
+ WARN_ON(1);
+ return -EINVAL;
+ }
+
if ((cpu_is_imx6sl() &&
imx_get_soc_revision() >= IMX_CHIP_REVISION_1_2) || cpu_is_imx6sx()) {