]> rtime.felk.cvut.cz Git - can-eth-gw-linux.git/blobdiff - drivers/hwmon/coretemp.c
hwmon: (coretemp) fix oops on cpu unplug
[can-eth-gw-linux.git] / drivers / hwmon / coretemp.c
index 0d3141fbbc204bbb533dfce334bc0a741f0b7095..54a70fe1244167bd5c5a04adc8c4cbff6a97cca5 100644 (file)
@@ -709,6 +709,10 @@ static void __cpuinit put_core_offline(unsigned int cpu)
 
        indx = TO_ATTR_NO(cpu);
 
+       /* The core id is too big, just return */
+       if (indx > MAX_CORE_DATA - 1)
+               return;
+
        if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu)
                coretemp_remove_core(pdata, &pdev->dev, indx);