On Tue, Apr 20, 2010 at 05:55:12PM +0800, Libin Yang wrote: > @@ -1335,6 +1361,85 @@ static int handle_tx_event(struct xhci_hcd *xhci, > } > } > } > + } else if (usb_endpoint_xfer_isoc(&td->urb->ep->desc)) { > + int idx; > + int len; You need to set len = 0 here. I get this warning: drivers/usb/host/xhci-ring.c: In function ‘handle_tx_event’: drivers/usb/host/xhci-ring.c:1414: warning: ‘len’ may be used uninitialized in this function > + int skip_td = 0; > + union xhci_trb *cur_trb; > + struct xhci_segment *cur_seg; > + > + urb_priv = td->urb->hcpriv; > + idx = urb_priv->td_cnt; > + status = 0; > + > + /* handle completion code */ > + switch (trb_comp_code) { > + case COMP_SUCCESS: > + td->urb->iso_frame_desc[idx].status = 0; > + xhci_dbg(xhci, "Successful isoc " > + "transfer!\n"); > + break; > + case COMP_SHORT_TX: > + xhci_dbg(xhci, "short transfer on isoc ep\n"); > + if (td->urb->transfer_flags & URB_SHORT_NOT_OK) > + td->urb->iso_frame_desc[idx].status = > + -EREMOTEIO; > + else > + td->urb->iso_frame_desc[idx].status = 0; > + break; > + case COMP_BW_OVER: > + td->urb->iso_frame_desc[idx].status = -ECOMM; > + skip_td = 1; > + break; > + case COMP_MISSED_INT: > + td->urb->iso_frame_desc[idx].status = -ECOMM; > + skip_td = 1; > + break; > + case COMP_BUFF_OVER: > + td->urb->iso_frame_desc[idx].status = -EOVERFLOW; > + skip_td = 1; > + break; > + case COMP_STALL: > + td->urb->iso_frame_desc[idx].status = -EPROTO; > + skip_td = 1; > + break; > + case COMP_BABBLE: > + td->urb->iso_frame_desc[idx].status = -EOVERFLOW; > + skip_td = 1; > + break; > + case COMP_STOP_INVAL: > + td->urb->iso_frame_desc[idx].status = -EREMOTEIO; > + break; > + case COMP_STOP: > + td->urb->iso_frame_desc[idx].status = -EREMOTEIO; > + break; > + default: > + td->urb->iso_frame_desc[idx].status = -1; > + break; > + } > + > + /* calc actual length */ > + if (trb_comp_code == COMP_SUCCESS || skip_td == 1) { > + td->urb->iso_frame_desc[idx].actual_length = > + td->urb->iso_frame_desc[idx].length; > + td->urb->actual_length += > + td->urb->iso_frame_desc[idx].length; > + } else { > + for (cur_trb = ep_ring->dequeue, > + cur_seg = ep_ring->deq_seg; cur_trb != event_trb; > + next_trb(xhci, ep_ring, &cur_seg, &cur_trb)) { > + if (TRB_TYPE(cur_trb->generic.field[3]) != > + TRB_TR_NOOP && > + TRB_TYPE(cur_trb->generic.field[3]) != > + TRB_LINK) > + len += > + TRB_LEN(cur_trb->generic.field[2]); > + } > + len += TRB_LEN(cur_trb->generic.field[2]) - > + TRB_LEN(event->transfer_len); You use it here, uninitialized, for the first pass through the for loop. Please fix. Sarah Sharp -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html