[ldv-project] [PATCH] irda: ali-ircc: Fix deadlock in ali_ircc_sir_change_speed()

David Miller davem at davemloft.net
Sat Sep 12 02:18:56 MSK 2015


From: Alexey Khoroshilov <khoroshilov at ispras.ru>
Date: Sat, 12 Sep 2015 00:34:48 +0300

> ali_ircc_sir_change_speed() is always called with self->lock held,
> so acquiring the lock inside it leads to unavoidable deadlock.
> 
> Call graph:
> ali_ircc_sir_change_speed() is called from ali_ircc_change_speed()
>   ali_ircc_fir_hard_xmit() under spin_lock_irqsave(&self->lock, flags);
>   ali_ircc_sir_hard_xmit() under spin_lock_irqsave(&self->lock, flags);
>   ali_ircc_net_ioctl() under spin_lock_irqsave(&self->lock, flags);
>   ali_ircc_dma_xmit_complete()
>     ali_ircc_fir_interrupt()
>       ali_ircc_interrupt() under spin_lock(&self->lock);
>   ali_ircc_sir_write_wakeup()
>     ali_ircc_sir_interrupt()
>       ali_ircc_interrupt() under spin_lock(&self->lock);
> 
> The patch removes spin_lock/unlock from ali_ircc_sir_change_speed().
> 
> Found by Linux Driver Verification project (linuxtesting.org).
> 
> Signed-off-by: Alexey Khoroshilov <khoroshilov at ispras.ru>

Looks good, applied, thanks.



More information about the ldv-project mailing list