From f89ce523e8f6eaa3d419b4853ad1b1ba75dd28f8 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Sat, 25 Apr 2015 23:54:02 -0300 Subject: [PATCH] atusb/fw/usb/usb.c (handle_setup): skip non-interface descriptors when processing SET_INTERFACE --- atusb/fw/usb/usb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/atusb/fw/usb/usb.c b/atusb/fw/usb/usb.c index 20b4d5f..4ced2a0 100644 --- a/atusb/fw/usb/usb.c +++ b/atusb/fw/usb/usb.c @@ -1,8 +1,8 @@ /* * fw/usb/usb.c - USB hardware setup and standard device requests * - * Written 2008-2011, 2013 by Werner Almesberger - * Copyright 2008-2011, 2013 Werner Almesberger + * Written 2008-2011, 2013, 2015 by Werner Almesberger + * Copyright 2008-2011, 2013, 2015 Werner Almesberger * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -145,6 +145,8 @@ bool handle_setup(const struct setup_request *setup) for (p = interface_descriptor; p != config_descriptor+config_descriptor[2]; p += p[0]) { + if (p[1] != USB_DT_INTERFACE) + continue; if (p[2] == setup->wIndex && p[3] == setup->wValue) { if (user_set_interface)