Searched hist:"6 b852620" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/drivers/media/dvb-frontends/ |
H A D | stv0910.c | 6b852620 Wed Aug 23 11:09:58 CDT 2017 Daniel Scheller <d.scheller@gmx.net> 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> 6b852620 Wed Aug 23 11:09:58 CDT 2017 Daniel Scheller <d.scheller@gmx.net> 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>
|