This patch will fix the situation where the mutex was left in a
locked state if for some reason the FE init failed.
Signed-off-by: Luis Alves <ljalvs@gmail.com>
Reviewed-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, &cmd);
if (ret != 0)
- return ret;
+ goto exit;
ret = cx24117_diseqc_init(fe);
if (ret != 0)
- return ret;
+ goto exit;
/* CMD 3C */
cmd.args[0] = 0x3c;
cmd.len = 4;
ret = cx24117_cmd_execute_nolock(fe, &cmd);
if (ret != 0)
- return ret;
+ goto exit;
/* CMD 34 */
cmd.args[0] = 0x34;
cmd.args[2] = CX24117_OCC;
cmd.len = 3;
ret = cx24117_cmd_execute_nolock(fe, &cmd);
- if (ret != 0)
- return ret;
+exit:
mutex_unlock(&state->priv->fe_lock);
return ret;