diff options
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r-- | drivers/hwmon/coretemp.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c index 0d3141fbbc20..b9d512331ed4 100644 --- a/drivers/hwmon/coretemp.c +++ b/drivers/hwmon/coretemp.c | |||
@@ -52,7 +52,7 @@ module_param_named(tjmax, force_tjmax, int, 0444); | |||
52 | MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius"); | 52 | MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius"); |
53 | 53 | ||
54 | #define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */ | 54 | #define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */ |
55 | #define NUM_REAL_CORES 16 /* Number of Real cores per cpu */ | 55 | #define NUM_REAL_CORES 32 /* Number of Real cores per cpu */ |
56 | #define CORETEMP_NAME_LENGTH 17 /* String Length of attrs */ | 56 | #define CORETEMP_NAME_LENGTH 17 /* String Length of attrs */ |
57 | #define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */ | 57 | #define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */ |
58 | #define TOTAL_ATTRS (MAX_CORE_ATTRS + 1) | 58 | #define TOTAL_ATTRS (MAX_CORE_ATTRS + 1) |
@@ -709,6 +709,10 @@ static void __cpuinit put_core_offline(unsigned int cpu) | |||
709 | 709 | ||
710 | indx = TO_ATTR_NO(cpu); | 710 | indx = TO_ATTR_NO(cpu); |
711 | 711 | ||
712 | /* The core id is too big, just return */ | ||
713 | if (indx > MAX_CORE_DATA - 1) | ||
714 | return; | ||
715 | |||
712 | if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu) | 716 | if (pdata->core_data[indx] && pdata->core_data[indx]->cpu == cpu) |
713 | coretemp_remove_core(pdata, &pdev->dev, indx); | 717 | coretemp_remove_core(pdata, &pdev->dev, indx); |
714 | 718 | ||