Skip to contentSkip to conversation

race condition in snd_timer_stop - Aiee!

PATCH New Clemens Ladisch 1 participant 1 message Apr 29, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 race condition in snd_timer_stop - Aiee!

If snd_timer_start schedules a timer instance to be started later and snd_timer_stop is called before the next timer interrupt, snd_timer_stop does not remove the (not yet running) timer instance from the active list. The patch should fix this.

Clemens

timer.c Sat Apr 27 17:48:51 2002 renamed from timer.c.orig Sat Apr 27 17:54:59 2002 +3 -0
@@ -424,6 +424,9 @@
                                }
                        }
                }
+       } else if (timeri->flags & SNDRV_TIMER_IFLG_START) {
+               timeri->flags &= ~SNDRV_TIMER_IFLG_START;
+               list_del_init(&timeri->active_list);
        }
        spin_unlock_irqrestore(&timer->lock, flags);
        return 0;