Commit 757a4a23 authored by Dave Jones's avatar Dave Jones

[CPUFREQ] Limit return value of speedstep_get_state()

Looking around speedstep-smi, there is a lot of call to
speedstep_get_state() which is used as an index for the array
speedstep_freqs.  But speedstep_get_state() will return the value of ebx
after a call to a SMI handler.  It's not safe IMHO.

From: Bruno Ducrot
Signed-off-by: default avatarDave Jones <davej@redhat.com>
parent fe3e41aa
...@@ -139,7 +139,7 @@ static int speedstep_get_state (void) ...@@ -139,7 +139,7 @@ static int speedstep_get_state (void)
: "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0) : "a" (command), "b" (function), "c" (0), "d" (smi_port), "S" (0)
); );
return state; return (state & 1);
} }
/** /**
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment