From: Sarah Sharp Date: Thu, 14 May 2009 18:44:14 +0000 (-0700) Subject: usb; xhci: Fix TRB offset calculations. X-Git-Tag: v2.6.31-rc1~304^2~5 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6071d8363b7b284038069f1795a98372fbc1a48e;p=pandora-kernel.git usb; xhci: Fix TRB offset calculations. Greg KH introduced a bug into xhci_trb_virt_to_dma() when he changed the type of offset to dma_addr_t from unsigned int and dropped the casts to unsigned int around the virtual address pointer subtraction. trb and seg->trbs are both valid pointers to virtual addresses, so the compiler will mod the subtraction by the size of union trb (16 bytes). segment_offset is an unsigned long, which is guaranteed to be at least as big as a void *. Drop the void * casts in the first if statement because trb and seg->trbs are both pointers of the same type (pointers to union trb). Signed-off-by: Sarah Sharp Signed-off-by: Greg Kroah-Hartman --- Reading git-diff-tree failed