Commit 107b7a21 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab

media: dvb-frontends: mb86a16.c: always use the same error path

If the message length was wrong, the dprintk() after the 'err' label
was bypassed. Fix that, and fix a smatch warning at the same time:

mb86a16.c:1514 mb86a16_send_diseqc_msg() warn: missing unwind goto?
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent 6a4c6645
...@@ -1498,6 +1498,7 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe, ...@@ -1498,6 +1498,7 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe,
struct dvb_diseqc_master_cmd *cmd) struct dvb_diseqc_master_cmd *cmd)
{ {
struct mb86a16_state *state = fe->demodulator_priv; struct mb86a16_state *state = fe->demodulator_priv;
int ret = -EREMOTEIO;
int i; int i;
u8 regs; u8 regs;
...@@ -1510,8 +1511,10 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe, ...@@ -1510,8 +1511,10 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe,
regs = 0x18; regs = 0x18;
if (cmd->msg_len > 5 || cmd->msg_len < 4) if (cmd->msg_len > 5 || cmd->msg_len < 4) {
return -EINVAL; ret = -EINVAL;
goto err;
}
for (i = 0; i < cmd->msg_len; i++) { for (i = 0; i < cmd->msg_len; i++) {
if (mb86a16_write(state, regs, cmd->msg[i]) < 0) if (mb86a16_write(state, regs, cmd->msg[i]) < 0)
...@@ -1532,7 +1535,7 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe, ...@@ -1532,7 +1535,7 @@ static int mb86a16_send_diseqc_msg(struct dvb_frontend *fe,
err: err:
dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error"); dprintk(verbose, MB86A16_ERROR, 1, "I2C transfer error");
return -EREMOTEIO; return ret;
} }
static int mb86a16_send_diseqc_burst(struct dvb_frontend *fe, static int mb86a16_send_diseqc_burst(struct dvb_frontend *fe,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment