Re: [PATCH 2/2] ALSA: timer: Assure timer resolution access always locked

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 May 2018 00:10:48 +0200,
Takashi Iwai wrote:
> 
> @@ -438,19 +438,24 @@ static unsigned long snd_timer_hw_resolution(struct snd_timer *timer)
>  unsigned long snd_timer_resolution(struct snd_timer_instance *timeri)
>  {
>  	struct snd_timer * timer;
> +	unsigned long ret = 0;
> +	unsigned long flags;
>  
>  	if (timeri == NULL)
>  		return 0;
>  	timer = timeri->timer;
> -	if (timer)
> -		return snd_timer_hw_resolution(timer);
> +	if (timer) {
> +		spin_lock_irqsave(&timer->lock, flags);
> +		ret = snd_timer_hw_resolution(timer);
> +		spin_unlock_irqrestore(&timer->lock, flags);
> +	}
>  	return 0;

This must be return ret, of course.
Will resend v2 series addressing this.


Takashi
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux