]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/speakup/synth.c
staging: speakup: avoid out-of-range access in synth_add()
[karo-tx-linux.git] / drivers / staging / speakup / synth.c
index b56880339225513a2a8b0912420af8c259fd7a13..7843111555e70e160123c031f99da8963b223963 100644 (file)
@@ -423,7 +423,7 @@ int synth_add(struct spk_synth *in_synth)
        int i;
        int status = 0;
        mutex_lock(&spk_mutex);
-       for (i = 0; synths[i] != NULL && i < MAXSYNTHS; i++)
+       for (i = 0; i < MAXSYNTHS && synths[i] != NULL; i++)
                /* synth_remove() is responsible for rotating the array down */
                if (in_synth == synths[i]) {
                        mutex_unlock(&spk_mutex);