Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310911
b: refs/heads/master
c: 46ed8f0
h: refs/heads/master
i:
  310909: 1780256
  310907: 80e0643
  310903: 36aeb4f
  310895: 7cb6ba9
  310879: f8ebc5c
  310847: 46ef8f3
  310783: 53570ff
v: v3
  • Loading branch information
Takashi Iwai authored and Sarah Sharp committed Jun 13, 2012
1 parent 829f219 commit e423e27
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e25e62aecac42379e113c63a674a86ae3ebbec8d
refs/heads/master: 46ed8f00d8982e49f8fe2c1a9cea192f640cb3ba
39 changes: 10 additions & 29 deletions trunk/drivers/usb/host/xhci-mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,10 +793,9 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci,
struct xhci_virt_device *virt_dev,
int slot_id)
{
struct list_head *tt;
struct list_head *tt_list_head;
struct list_head *tt_next;
struct xhci_tt_bw_info *tt_info;
struct xhci_tt_bw_info *tt_info, *next;
bool slot_found = false;

/* If the device never made it past the Set Address stage,
* it may not have the real_port set correctly.
Expand All @@ -808,34 +807,16 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci,
}

tt_list_head = &(xhci->rh_bw[virt_dev->real_port - 1].tts);
if (list_empty(tt_list_head))
return;

list_for_each(tt, tt_list_head) {
tt_info = list_entry(tt, struct xhci_tt_bw_info, tt_list);
if (tt_info->slot_id == slot_id)
list_for_each_entry_safe(tt_info, next, tt_list_head, tt_list) {
/* Multi-TT hubs will have more than one entry */
if (tt_info->slot_id == slot_id) {
slot_found = true;
list_del(&tt_info->tt_list);
kfree(tt_info);
} else if (slot_found) {
break;
}
}
/* Cautionary measure in case the hub was disconnected before we
* stored the TT information.
*/
if (tt_info->slot_id != slot_id)
return;

tt_next = tt->next;
tt_info = list_entry(tt, struct xhci_tt_bw_info,
tt_list);
/* Multi-TT hubs will have more than one entry */
do {
list_del(tt);
kfree(tt_info);
tt = tt_next;
if (list_empty(tt_list_head))
break;
tt_next = tt->next;
tt_info = list_entry(tt, struct xhci_tt_bw_info,
tt_list);
} while (tt_info->slot_id == slot_id);
}

int xhci_alloc_tt_info(struct xhci_hcd *xhci,
Expand Down

0 comments on commit e423e27

Please sign in to comment.