mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
lx_emul: active config validation in usb driver
Fix genodelabs/genode#4567
This commit is contained in:
parent
92a5fa9bed
commit
560747c22e
@ -233,7 +233,7 @@ static int usb_rpc_call(void * data)
|
||||
|
||||
if (usb_rpc_args.call == RELEASE_ALL) {
|
||||
i = 0;
|
||||
num = udev->actconfig->desc.bNumInterfaces;
|
||||
num = (udev->actconfig) ? udev->actconfig->desc.bNumInterfaces : 0;
|
||||
} else {
|
||||
i = usb_rpc_args.iface_num;
|
||||
num = i + 1;
|
||||
@ -771,7 +771,7 @@ static int raw_notify(struct notifier_block *nb, unsigned long action, void *dat
|
||||
* policies.
|
||||
*/
|
||||
unsigned long class;
|
||||
unsigned i;
|
||||
unsigned i, num;
|
||||
struct usb_iface_urbs *urbs = (struct usb_iface_urbs*)
|
||||
kmalloc(sizeof(struct usb_iface_urbs), GFP_KERNEL);
|
||||
init_usb_anchor(&urbs->submitted);
|
||||
@ -779,8 +779,12 @@ static int raw_notify(struct notifier_block *nb, unsigned long action, void *dat
|
||||
dev_set_drvdata(&udev->dev, urbs);
|
||||
|
||||
|
||||
for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) {
|
||||
struct usb_interface * iface = udev->actconfig->interface[i];
|
||||
class = 0;
|
||||
num = (udev->actconfig) ?
|
||||
udev->actconfig->desc.bNumInterfaces : 0;
|
||||
for (i = 0; i < num; i++) {
|
||||
struct usb_interface * iface =
|
||||
(udev->actconfig) ? udev->actconfig->interface[i] : NULL;
|
||||
if (!iface || !iface->cur_altsetting) continue;
|
||||
if (i == 0 ||
|
||||
iface->cur_altsetting->desc.bInterfaceClass ==
|
||||
|
Loading…
Reference in New Issue
Block a user