NetBSD-Bugs archive

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

powernow driver bug



Hi,

sys/arch/x86/x86/powernow.c

the following patch fixes an access beyond the limits of a vector:

diff --git a/sys/arch/x86/x86/powernow.c b/sys/arch/x86/x86/powernow.c
old mode 100644
new mode 100755
index c8f1704..8a362f0
--- a/sys/arch/x86/x86/powernow.c
+++ b/sys/arch/x86/x86/powernow.c
@@ -418,8 +418,8 @@ powernow_k7_init(device_t self)
     for (i = 0; i < sc->sc_state->n_states; i++) {

             /* Skip duplicated matches. */
-               if (sc->sc_state->state_table[i].freq ==
-                   sc->sc_state->state_table[i - 1].freq)
+               if (i > 0 && (sc->sc_state->state_table[i].freq ==
+                   sc->sc_state->state_table[i - 1].freq))
                     continue;

             DPRINTF(("%s: cstate->state_table.freq=%d\n",

Cheers,

-- 
--------------------
Maurizio Lombardi

Attachment: powernow.patch
Description: Binary data



Home | Main Index | Thread Index | Old Index