Nico Huber (nico.huber@secunet.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/1082
-gerrit
commit bab32430f9e8c9588912ff41ce48ede6edd129b4 Author: Nico Huber nico.huber@secunet.com Date: Fri May 25 09:59:19 2012 +0200
libpayload: Free intr queue structure in usb_hid_destroy
The call to destroy_intr_queue was missing in usb_hid_destroy.
Change-Id: I51ccc6a79bc005819317263be24a56c51acd5f55 Signed-off-by: Nico Huber nico.huber@secunet.com --- payloads/libpayload/drivers/usb/usbhid.c | 27 +++++++++++++++++++++------ 1 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/payloads/libpayload/drivers/usb/usbhid.c b/payloads/libpayload/drivers/usb/usbhid.c index 840b298..d5141c6 100644 --- a/payloads/libpayload/drivers/usb/usbhid.c +++ b/payloads/libpayload/drivers/usb/usbhid.c @@ -42,12 +42,6 @@ enum { GET_REPORT = 0x1, GET_IDLE = 0x2, GET_PROTOCOL = 0x3, SET_REPORT = 0x9, SET_IDLE = 0xa, SET_PROTOCOL = 0xb };
-static void -usb_hid_destroy (usbdev_t *dev) -{ - free (dev->data); -} - typedef struct { void* queue; hid_descriptor_t *descriptor; @@ -55,6 +49,27 @@ typedef struct {
#define HID_INST(dev) ((usbhid_inst_t*)(dev)->data)
+static void +usb_hid_destroy (usbdev_t *dev) +{ + if (HID_INST(dev)->queue) { + int i; + for (i = 0; i <= dev->num_endp; i++) { + if (dev->endpoints[i].endpoint == 0) + continue; + if (dev->endpoints[i].type != INTERRUPT) + continue; + if (dev->endpoints[i].direction != IN) + continue; + break; + } + dev->controller->destroy_intr_queue( + &dev->endpoints[i], HID_INST(dev)->queue); + HID_INST(dev)->queue = NULL; + } + free (dev->data); +} + /* keybuffer is global to all USB keyboards */ static int keycount; #define KEYBOARD_BUFFER_SIZE 16