diff options
author | Alan Cox <alan@linux.intel.com> | 2012-05-22 20:45:13 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-06-22 11:36:58 -0700 |
commit | 8951420c6c7a04504659319692435ac627f3f795 (patch) | |
tree | 84e711996dbd97d87091a5c0aa4632bf003bd33d | |
parent | c1cbfb94dab7c2f5092d0eef4ce87fdb4119a7ce (diff) | |
download | linux-stable-8951420c6c7a04504659319692435ac627f3f795.tar.gz linux-stable-8951420c6c7a04504659319692435ac627f3f795.tar.bz2 linux-stable-8951420c6c7a04504659319692435ac627f3f795.zip |
USB: mct_u232: Fix incorrect TIOCMSET return
commit 1aa3c63cf0a79153ee13c8f82e4eb6c40b66a161 upstream.
The low level helper returns 1 on success. The ioctl should however return
0. As this is the only user of the helper return, make the helper return 0 or
an error code.
Resolves-bug: https://bugzilla.kernel.org/show_bug.cgi?id=43009
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/usb/serial/mct_u232.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c index 6edd26130e25..ef4d7adfbd9d 100644 --- a/drivers/usb/serial/mct_u232.c +++ b/drivers/usb/serial/mct_u232.c @@ -317,13 +317,16 @@ static int mct_u232_set_modem_ctrl(struct usb_serial *serial, MCT_U232_SET_REQUEST_TYPE, 0, 0, buf, MCT_U232_SET_MODEM_CTRL_SIZE, WDR_TIMEOUT); - if (rc < 0) - dev_err(&serial->dev->dev, - "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); + kfree(buf); + dbg("set_modem_ctrl: state=0x%x ==> mcr=0x%x", control_state, mcr); - kfree(buf); - return rc; + if (rc < 0) { + dev_err(&serial->dev->dev, + "Set MODEM CTRL 0x%x failed (error = %d)\n", mcr, rc); + return rc; + } + return 0; } /* mct_u232_set_modem_ctrl */ static int mct_u232_get_modem_stat(struct usb_serial *serial, |