|
@@ -225,6 +225,12 @@ passive_store(struct device *dev, struct device_attribute *attr,
|
|
if (!sscanf(buf, "%d\n", &state))
|
|
if (!sscanf(buf, "%d\n", &state))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ /* sanity check: values below 1000 millicelcius don't make sense
|
|
|
|
+ * and can cause the system to go into a thermal heart attack
|
|
|
|
+ */
|
|
|
|
+ if (state && state < 1000)
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
if (state && !tz->forced_passive) {
|
|
if (state && !tz->forced_passive) {
|
|
mutex_lock(&thermal_list_lock);
|
|
mutex_lock(&thermal_list_lock);
|
|
list_for_each_entry(cdev, &thermal_cdev_list, node) {
|
|
list_for_each_entry(cdev, &thermal_cdev_list, node) {
|