diff options
author | Joakim Tufvegren <jocke@barbanet.com> | 2021-07-12 17:43:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-12 08:43:05 -0700 |
commit | 4706231831b7b5926052ee1affc7f38a165c7761 (patch) | |
tree | 8296bbe30b5afd84c7db55a23db8bea6bbb32105 /quantum/matrix.c | |
parent | 89980ff0044c17a9eeb58007ae35330f1d58605b (diff) | |
download | qmk_firmware-4706231831b7b5926052ee1affc7f38a165c7761.tar.gz qmk_firmware-4706231831b7b5926052ee1affc7f38a165c7761.zip |
Fix two out of bounds accesses from #13330. (#13525)
Two occurrences of `MATRIX_ROWS` weren't properly changed to
`ROWS_PER_HAND` in #13330, causing a crash during boot on at least my
Ergodox Infinity (including #13481).
Diffstat (limited to 'quantum/matrix.c')
-rw-r--r-- | quantum/matrix.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/quantum/matrix.c b/quantum/matrix.c index ed4643f81..235b16769 100644 --- a/quantum/matrix.c +++ b/quantum/matrix.c | |||
@@ -149,7 +149,7 @@ static void unselect_row(uint8_t row) { | |||
149 | } | 149 | } |
150 | 150 | ||
151 | static void unselect_rows(void) { | 151 | static void unselect_rows(void) { |
152 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { | 152 | for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { |
153 | unselect_row(x); | 153 | unselect_row(x); |
154 | } | 154 | } |
155 | } | 155 | } |
@@ -214,7 +214,7 @@ static void unselect_cols(void) { | |||
214 | 214 | ||
215 | __attribute__((weak)) void matrix_init_pins(void) { | 215 | __attribute__((weak)) void matrix_init_pins(void) { |
216 | unselect_cols(); | 216 | unselect_cols(); |
217 | for (uint8_t x = 0; x < MATRIX_ROWS; x++) { | 217 | for (uint8_t x = 0; x < ROWS_PER_HAND; x++) { |
218 | if (row_pins[x] != NO_PIN) { | 218 | if (row_pins[x] != NO_PIN) { |
219 | setPinInputHigh_atomic(row_pins[x]); | 219 | setPinInputHigh_atomic(row_pins[x]); |
220 | } | 220 | } |