Skip to content

Commit 9c1fe96

Browse files
committed
ALSA: timer: Fix master timer notification
snd_timer_notify1() calls the notification to each slave for a master event, but it passes a wrong event number. It should be +10 offset, corresponding to SNDRV_TIMER_EVENT_MXXX, but it's incorrectly with +100 offset. Casually this was spotted by UBSAN check via syzkaller. Reported-by: [email protected] Reviewed-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 3ae72f6 commit 9c1fe96

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

sound/core/timer.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,10 @@ static void snd_timer_notify1(struct snd_timer_instance *ti, int event)
520520
return;
521521
if (timer->hw.flags & SNDRV_TIMER_HW_SLAVE)
522522
return;
523+
event += 10; /* convert to SNDRV_TIMER_EVENT_MXXX */
523524
list_for_each_entry(ts, &ti->slave_active_head, active_list)
524525
if (ts->ccallback)
525-
ts->ccallback(ts, event + 100, &tstamp, resolution);
526+
ts->ccallback(ts, event, &tstamp, resolution);
526527
}
527528

528529
/* start/continue a master timer */

0 commit comments

Comments
 (0)