aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/misc/intel_menlow.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index e00a2756e97e..124b37ddb5c1 100644
--- a/drivers/misc/intel_menlow.c
+++ b/drivers/misc/intel_menlow.c
@@ -71,6 +71,9 @@ static int memory_get_int_max_bandwidth(struct thermal_cooling_device *cdev,
71 if (ACPI_FAILURE(status)) 71 if (ACPI_FAILURE(status))
72 return -EFAULT; 72 return -EFAULT;
73 73
74 if (!value)
75 return -EINVAL;
76
74 *max_state = value - 1; 77 *max_state = value - 1;
75 return 0; 78 return 0;
76} 79}
@@ -121,7 +124,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
121 if (memory_get_int_max_bandwidth(cdev, &max_state)) 124 if (memory_get_int_max_bandwidth(cdev, &max_state))
122 return -EFAULT; 125 return -EFAULT;
123 126
124 if (max_state < 0 || state > max_state) 127 if (state > max_state)
125 return -EINVAL; 128 return -EINVAL;
126 129
127 arg_list.count = 1; 130 arg_list.count = 1;