diff options
Diffstat (limited to 'drivers/usb/serial/safe_serial.c')
-rw-r--r-- | drivers/usb/serial/safe_serial.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/usb/serial/safe_serial.c b/drivers/usb/serial/safe_serial.c index 93c6c9b08daa..8a069aa154ed 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c | |||
@@ -200,6 +200,11 @@ static void safe_process_read_urb(struct urb *urb) | |||
200 | if (!safe) | 200 | if (!safe) |
201 | goto out; | 201 | goto out; |
202 | 202 | ||
203 | if (length < 2) { | ||
204 | dev_err(&port->dev, "malformed packet\n"); | ||
205 | return; | ||
206 | } | ||
207 | |||
203 | fcs = fcs_compute10(data, length, CRC10_INITFCS); | 208 | fcs = fcs_compute10(data, length, CRC10_INITFCS); |
204 | if (fcs) { | 209 | if (fcs) { |
205 | dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs); | 210 | dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs); |