irda: ali-ircc: Fix deadlock in ali_ircc_sir_change_speed()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 11 Sep 2015 21:34:48 +0000 (00:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Fri, 11 Sep 2015 23:18:33 +0000 (16:18 -0700)
commite8684c88774c0ddfeefdbed0aa469b25b9962f3e
treee88c7b91bd30df72be335b9577d30126a4851523
parent38c089d1d8d058f5dff018a811568aa8e8bc47fc
irda: ali-ircc: Fix deadlock in ali_ircc_sir_change_speed()

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@ispras.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/irda/ali-ircc.c