Julia Lawall wrote: > I don't understand the function qset_add_urb_sg. As far as I can tell, > the variable std is NULL until reaching the following code: > > if (!std > || (prev_end & (WHCI_PAGE_SIZE-1)) > || (dma_addr & (WHCI_PAGE_SIZE-1)) > || std->len + WHCI_PAGE_SIZE > QTD_MAX_XFER_SIZE) { > if (std->len % qset->max_packet != 0) This should be if (std && std->len % qset->maxpacket !=0) > return -EINVAL; > std = qset_new_std(whc, qset, urb, mem_flags); > if (std == NULL) { > return -ENOMEM; > } > ntds++; > p = 0; > } > > The it crashes on the first inner if. Indeed, it seems that the only way > the function can work is if remaining is 0, in which case the entire > for_each_sg is useless. But perhaps I am missing something? David -- David Vrabel, Senior Software Engineer, Drivers CSR, Churchill House, Cambridge Business Park, Tel: +44 (0)1223 692562 Cowley Road, Cambridge, CB4 0WZ http://www.csr.com/ Member of the CSR plc group of companies. CSR plc registered in England and Wales, registered number 4187346, registered office Churchill House, Cambridge Business Park, Cowley Road, Cambridge, CB4 0WZ, United Kingdom -- 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