mirror of
https://github.com/armbian/linux.git
synced 2026-01-06 10:13:00 -08:00
USB: cdc-acm: check for valid interfaces
commit 403dff4e2c upstream.
We need to check that we have both a valid data and control inteface for both
types of headers (union and not union.)
References: https://bugzilla.kernel.org/show_bug.cgi?id=83551
Reported-by: Simon Schubert <2+kernel@0x2c.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
@@ -1087,10 +1087,11 @@ next_desc:
|
||||
} else {
|
||||
control_interface = usb_ifnum_to_if(usb_dev, union_header->bMasterInterface0);
|
||||
data_interface = usb_ifnum_to_if(usb_dev, (data_interface_num = union_header->bSlaveInterface0));
|
||||
if (!control_interface || !data_interface) {
|
||||
dev_dbg(&intf->dev, "no interfaces\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
}
|
||||
|
||||
if (!control_interface || !data_interface) {
|
||||
dev_dbg(&intf->dev, "no interfaces\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (data_interface_num != call_interface_num)
|
||||
|
||||
Reference in New Issue
Block a user