diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-05 10:25:02 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-09-05 10:25:02 -0400 |
| commit | d8c3916023d438a40cf16b284ee6ae7acab57b64 (patch) | |
| tree | 8028419822118104c7c52017eae1d2d5d18a84dc /drivers | |
| parent | 6e22e3af7bb3a7b9dc53cb4687659f6e63fca427 (diff) | |
| parent | 5dfdd24eb3d39d815bc952ae98128e967c9bba49 (diff) | |
Merge tag 'usb-serial-4.19-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes:
USB-serial fixes for v4.19-rc3
Here are two fixes for array-underflow bugs in completion handlers due
to insufficient sanity checks.
All have been in linux-next with no reported issues.
Signed-off-by: Johan Hovold <johan@kernel.org>
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/usb/serial/io_ti.h | 2 | ||||
| -rw-r--r-- | drivers/usb/serial/ti_usb_3410_5052.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/serial/io_ti.h b/drivers/usb/serial/io_ti.h index e53c68261017..9bbcee37524e 100644 --- a/drivers/usb/serial/io_ti.h +++ b/drivers/usb/serial/io_ti.h | |||
| @@ -173,7 +173,7 @@ struct ump_interrupt { | |||
| 173 | } __attribute__((packed)); | 173 | } __attribute__((packed)); |
| 174 | 174 | ||
| 175 | 175 | ||
| 176 | #define TIUMP_GET_PORT_FROM_CODE(c) (((c) >> 4) - 3) | 176 | #define TIUMP_GET_PORT_FROM_CODE(c) (((c) >> 6) & 0x01) |
| 177 | #define TIUMP_GET_FUNC_FROM_CODE(c) ((c) & 0x0f) | 177 | #define TIUMP_GET_FUNC_FROM_CODE(c) ((c) & 0x0f) |
| 178 | #define TIUMP_INTERRUPT_CODE_LSR 0x03 | 178 | #define TIUMP_INTERRUPT_CODE_LSR 0x03 |
| 179 | #define TIUMP_INTERRUPT_CODE_MSR 0x04 | 179 | #define TIUMP_INTERRUPT_CODE_MSR 0x04 |
diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c index 3010878f7f8e..e3c5832337e0 100644 --- a/drivers/usb/serial/ti_usb_3410_5052.c +++ b/drivers/usb/serial/ti_usb_3410_5052.c | |||
| @@ -1119,7 +1119,7 @@ static void ti_break(struct tty_struct *tty, int break_state) | |||
| 1119 | 1119 | ||
| 1120 | static int ti_get_port_from_code(unsigned char code) | 1120 | static int ti_get_port_from_code(unsigned char code) |
| 1121 | { | 1121 | { |
| 1122 | return (code >> 4) - 3; | 1122 | return (code >> 6) & 0x01; |
| 1123 | } | 1123 | } |
| 1124 | 1124 | ||
| 1125 | static int ti_get_func_from_code(unsigned char code) | 1125 | static int ti_get_func_from_code(unsigned char code) |
