thermal: rcar_thermal: avoid NULL dereference in absence of IRQ resources
[platform/kernel/linux-starfive.git] / drivers / thermal / rcar_thermal.c
index 45fb284..e77e630 100644 (file)
@@ -598,7 +598,7 @@ static int rcar_thermal_probe(struct platform_device *pdev)
                        enr_bits |= 3 << (i * 8);
        }
 
-       if (enr_bits)
+       if (common->base && enr_bits)
                rcar_thermal_common_write(common, ENR, enr_bits);
 
        dev_info(dev, "%d sensor probed\n", i);