USB: serial: safe_serial: fix information leak in completion handler
am: 3cdc946387
Change-Id: I2a29b5d7a753bd94d320bda52427bd62ab042787
This commit is contained in:
commit
a94cfa2ac4
1 changed files with 5 additions and 0 deletions
|
@ -205,6 +205,11 @@ static void safe_process_read_urb(struct urb *urb)
|
|||
if (!safe)
|
||||
goto out;
|
||||
|
||||
if (length < 2) {
|
||||
dev_err(&port->dev, "malformed packet\n");
|
||||
return;
|
||||
}
|
||||
|
||||
fcs = fcs_compute10(data, length, CRC10_INITFCS);
|
||||
if (fcs) {
|
||||
dev_err(&port->dev, "%s - bad CRC %x\n", __func__, fcs);
|
||||
|
|
Loading…
Add table
Reference in a new issue