Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0584ffa5 authored by Takashi Iwai's avatar Takashi Iwai
Browse files

ALSA: timer - Fix Oops at closing slave timer

A slave-timer instance has no timer reference, and this results in
NULL-dereference at stopping the timer, typically called at closing
the device.

Reference: https://bugzilla.kernel.org/show_bug.cgi?id=40682



Cc: <stable@kernel.org>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 67ada836
Loading
Loading
Loading
Loading
+2 −0
Original line number Original line Diff line number Diff line
@@ -531,6 +531,8 @@ int snd_timer_stop(struct snd_timer_instance *timeri)
	if (err < 0)
	if (err < 0)
		return err;
		return err;
	timer = timeri->timer;
	timer = timeri->timer;
	if (!timer)
		return -EINVAL;
	spin_lock_irqsave(&timer->lock, flags);
	spin_lock_irqsave(&timer->lock, flags);
	timeri->cticks = timeri->ticks;
	timeri->cticks = timeri->ticks;
	timeri->pticks = 0;
	timeri->pticks = 0;