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 b2dff0f14743..236ea43f7815 100644 --- a/drivers/usb/serial/safe_serial.c +++ b/drivers/usb/serial/safe_serial.c | |||
@@ -205,6 +205,11 @@ static void safe_process_read_urb(struct urb *urb) | |||
205 | if (!safe) | 205 | if (!safe) |
206 | goto out; | 206 | goto out; |
207 | 207 | ||
208 | if (length < 2) { | ||
209 | dev_err(&port->dev, "malformed packet\n"); | ||
210 | return; | ||
211 | } | ||
212 | |||
208 | fcs = fcs_compute10(data, length, CRC10_INITFCS); | 213 | fcs = fcs_compute10(data, length, CRC10_INITFCS); |
209 | if (fcs) { | 214 | if (fcs) { |
210 | dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs); | 215 | dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs); |