Commit de30f7a
committed
ASoC: SOF: serial: fix win_offset check to use <= 0
The serial client driver stores the shell debug window slot offset as a
signed ssize_t. sof_client_ipc4_find_debug_slot_offset_by_type() returns
0 when the slot is not found (not -1), so 'offset < 0' is the wrong test —
a return of 0 silently bypasses the error path and causes a crash when the
offset is later used in mailbox reads/writes.
Fix all callers in sof-client-serial.c to use '<= 0'.
Fixes: 2dedd18 ("sound: sof: add sof client driver for terminal.")
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>1 parent f9ca42c commit de30f7a
1 file changed
Lines changed: 5 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
378 | 378 | | |
379 | 379 | | |
380 | 380 | | |
381 | | - | |
| 381 | + | |
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
| |||
411 | 411 | | |
412 | 412 | | |
413 | 413 | | |
414 | | - | |
| 414 | + | |
415 | 415 | | |
416 | 416 | | |
417 | 417 | | |
| |||
469 | 469 | | |
470 | 470 | | |
471 | 471 | | |
472 | | - | |
| 472 | + | |
473 | 473 | | |
474 | 474 | | |
475 | 475 | | |
| |||
0 commit comments