mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
USB: mos7840: fix tiocmget error handling
commit a91ccd26e7
upstream.
Make sure to return errors from tiocmget rather than rely on
uninitialised stack data.
Signed-off-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
8e5931c319
commit
a4f4086ae8
1 changed files with 4 additions and 0 deletions
|
@ -1664,7 +1664,11 @@ static int mos7840_tiocmget(struct tty_struct *tty)
|
|||
return -ENODEV;
|
||||
|
||||
status = mos7840_get_uart_reg(port, MODEM_STATUS_REGISTER, &msr);
|
||||
if (status != 1)
|
||||
return -EIO;
|
||||
status = mos7840_get_uart_reg(port, MODEM_CONTROL_REGISTER, &mcr);
|
||||
if (status != 1)
|
||||
return -EIO;
|
||||
result = ((mcr & MCR_DTR) ? TIOCM_DTR : 0)
|
||||
| ((mcr & MCR_RTS) ? TIOCM_RTS : 0)
|
||||
| ((mcr & MCR_LOOPBACK) ? TIOCM_LOOP : 0)
|
||||
|
|
Loading…
Reference in a new issue