Merge "ALSA: timer: Fix leak in events via snd_timer_user_ccallback"

This commit is contained in:
Linux Build Service Account 2016-09-08 20:01:39 -07:00 committed by Gerrit - the friendly Code Review server
commit 340cc56cc2

View file

@ -1247,6 +1247,7 @@ static void snd_timer_user_ccallback(struct snd_timer_instance *timeri,
tu->tstamp = *tstamp; tu->tstamp = *tstamp;
if ((tu->filter & (1 << event)) == 0 || !tu->tread) if ((tu->filter & (1 << event)) == 0 || !tu->tread)
return; return;
memset(&r1, 0, sizeof(r1));
r1.event = event; r1.event = event;
r1.tstamp = *tstamp; r1.tstamp = *tstamp;
r1.val = resolution; r1.val = resolution;
@ -1281,6 +1282,7 @@ static void snd_timer_user_tinterrupt(struct snd_timer_instance *timeri,
} }
if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) && if ((tu->filter & (1 << SNDRV_TIMER_EVENT_RESOLUTION)) &&
tu->last_resolution != resolution) { tu->last_resolution != resolution) {
memset(&r1, 0, sizeof(r1));
r1.event = SNDRV_TIMER_EVENT_RESOLUTION; r1.event = SNDRV_TIMER_EVENT_RESOLUTION;
r1.tstamp = tstamp; r1.tstamp = tstamp;
r1.val = resolution; r1.val = resolution;