public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] intel_menlo: max_state is unsigned, invalid test
@ 2008-10-29 21:06 roel kluin
  2008-11-03 22:35 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: roel kluin @ 2008-10-29 21:06 UTC (permalink / raw)
  To: len.brown; +Cc: linux-kernel

max_state is unsigned, so the test is invalid.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
I think max_state can only become -1, no? then probably a different
patch is required.
I may not be able to respond for a few weeks.

diff --git a/drivers/misc/intel_menlow.c b/drivers/misc/intel_menlow.c
index e00a275..980171d 100644
--- a/drivers/misc/intel_menlow.c
+++ b/drivers/misc/intel_menlow.c
@@ -121,7 +121,7 @@ static int memory_set_cur_bandwidth(struct thermal_cooling_device *cdev,
 	if (memory_get_int_max_bandwidth(cdev, &max_state))
 		return -EFAULT;
 
-	if (max_state < 0 || state > max_state)
+	if (max_state == -1 || state > max_state)
 		return -EINVAL;
 
 	arg_list.count = 1;


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2008-11-05 10:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-29 21:06 [PATCH] intel_menlo: max_state is unsigned, invalid test roel kluin
2008-11-03 22:35 ` Andrew Morton
2008-11-04  4:07   ` Len Brown
2008-11-05 10:20     ` Thomas, Sujith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox