[PATCH] intel_menlow: don't set max_state a negative value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



max_state is unsigned long.
don't set max_state a negative value

Cc : Thomas Sujith <sujith.thomas@xxxxxxxxx>
Cc : Roel Kluin <roel.kluin@xxxxxxxxx>
Signed-off-by: Zhang Rui <rui.zhang@xxxxxxxxx>
---
 drivers/misc/intel_menlow.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Index: linux-2.6/drivers/misc/intel_menlow.c
===================================================================
--- linux-2.6.orig/drivers/misc/intel_menlow.c	2008-07-29 09:32:11.000000000 +0800
+++ linux-2.6/drivers/misc/intel_menlow.c	2008-09-11 09:17:48.000000000 +0800
@@ -71,6 +71,9 @@
 	if (ACPI_FAILURE(status))
 		return -EFAULT;
 
+	if (!value)
+		return -EINVAL;
+
 	*max_state = value - 1;
 	return 0;
 }
@@ -121,7 +124,7 @@
 	if (memory_get_int_max_bandwidth(cdev, &max_state))
 		return -EFAULT;
 
-	if (max_state < 0 || state > max_state)
+	if (state > max_state)
 		return -EINVAL;
 
 	arg_list.count = 1;


--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux