MEDIA: lirc, improper locking

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

 



Hi,

stanse found a locking error in lirc_dev_fop_read:
if (mutex_lock_interruptible(&ir->irctl_lock))
  return -ERESTARTSYS;
...
while (written < length && ret == 0) {
  if (mutex_lock_interruptible(&ir->irctl_lock)) {    #1
    ret = -ERESTARTSYS;
    break;
  }
  ...
}

remove_wait_queue(&ir->buf->wait_poll, &wait);
set_current_state(TASK_RUNNING);
mutex_unlock(&ir->irctl_lock);                        #2

If lock at #1 fails, it beaks out of the loop, with the lock unlocked,
but there is another "unlock" at #2.

regards,
-- 
js
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux