Skip to content
  • Hans Verkuil's avatar
    [media] cec: improve locking · 2ab25d35
    Hans Verkuil authored
    
    
    - The global lock was used in cec_get_device when it should have
      used the devnode lock.
    - cec_put_device also took the global lock, but since the release
      function takes that lock as well this could lead to a deadlock.
      Just don't take the lock here since there is no reason for it.
    - cec_devnode_register() should take the global lock when clearing
      the bit in the global bitmap.
    - In cec_devnode_unregister() place the devnode->(un)register tests
      and assignments under the devnode lock as well: this has to be
      in a critical block.
    
    Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
    2ab25d35