]> git.baikalelectronics.ru Git - kernel.git/commit
media: dvb-frontends/stv0910: release lock on gate_ctrl() failure
authorDaniel Scheller <d.scheller@gmx.net>
Wed, 23 Aug 2017 16:09:58 +0000 (12:09 -0400)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Sun, 27 Aug 2017 10:35:13 +0000 (06:35 -0400)
commita09ced5cd4db05693bcae2769eb199bbd9d69216
treecba4ee9ccc44b17acfe77d73505ec92709cd74f7
parent6c73f5e368cae23d9b6b18b92085ce9fce025f92
media: dvb-frontends/stv0910: release lock on gate_ctrl() failure

Whenever write_reg() fails to open/close the demod's I2C gate, release the
lock to avoid deadlocking situations. If I2c gate open failed, there's no
need to hold a lock, and if close fails, the mutex_unlock() at the end of
the function is never reached, leaving the mutex_lock in locked state,
which in turn will cause potential for deadlocks. Thus, release the lock
on failure.

While we're touching gate_ctrl(), add some explanation about the need for
locking and the shared I2C bus/gate.

Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Daniel Scheller <d.scheller@gmx.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/dvb-frontends/stv0910.c