[media] cec: improve locking
authorHans Verkuil <hans.verkuil@cisco.com>
Tue, 2 Aug 2016 11:13:57 +0000 (08:13 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 22 Aug 2016 16:14:21 +0000 (13:14 -0300)
commit2ab25d35a91098ef0f42d478cc37f6a5591a4ab0
treed23b665dc4fb9977e9abf443626279a3364a0d5a
parent62148f0930a8e9bd5c5614f8387222f0220d7d47
[media] cec: improve locking

- 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: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/staging/media/cec/cec-core.c
This page took 0.025283 seconds and 5 git commands to generate.