i2c: jz4780: prevent potential division by zero
[cascardo/linux.git] / drivers / i2c / busses / i2c-jz4780.c
index f325663..597408f 100644 (file)
@@ -770,7 +770,7 @@ static int jz4780_i2c_probe(struct platform_device *pdev)
 
        ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
                                   &clk_freq);
-       if (ret) {
+       if (ret || clk_freq == 0) {
                dev_err(&pdev->dev, "clock-frequency not specified in DT");
                goto err;
        }