Commit a420b5d9 authored by Johan Hovold's avatar Johan Hovold

USB: serial: kobil_sct: fix modem-status error handling

Make sure to return -EIO in case of a short modem-status read request.

While at it, split the debug message to not include the (zeroed)
transfer-buffer content in case of errors.

Fixes: 1da177e4 ("Linux-2.6.12-rc2")
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parent 1d1de580
......@@ -393,12 +393,20 @@ static int kobil_tiocmget(struct tty_struct *tty)
transfer_buffer_length,
KOBIL_TIMEOUT);
dev_dbg(&port->dev, "%s - Send get_status_line_state URB returns: %i. Statusline: %02x\n",
__func__, result, transfer_buffer[0]);
dev_dbg(&port->dev, "Send get_status_line_state URB returns: %i\n",
result);
if (result < 1) {
if (result >= 0)
result = -EIO;
goto out_free;
}
dev_dbg(&port->dev, "Statusline: %02x\n", transfer_buffer[0]);
result = 0;
if ((transfer_buffer[0] & SUSBCR_GSL_DSR) != 0)
result = TIOCM_DSR;
out_free:
kfree(transfer_buffer);
return result;
}
......
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