diff options
author | Paul Zimmerman <Paul.Zimmerman@synopsys.com> | 2011-02-12 14:07:20 -0800 |
---|---|---|
committer | Sarah Sharp <sarah.a.sharp@linux.intel.com> | 2011-02-20 07:01:27 -0800 |
commit | 5807795bd4dececdf553719cc02869e633395787 (patch) | |
tree | d200e995de9dffbc6e6e44a8da4fcdc5f37a94aa /virt | |
parent | a2490187011cc2263117626615a581927d19f1d3 (diff) | |
download | linux-stable-5807795bd4dececdf553719cc02869e633395787.tar.gz linux-stable-5807795bd4dececdf553719cc02869e633395787.tar.bz2 linux-stable-5807795bd4dececdf553719cc02869e633395787.zip |
xhci: Fix errors in the running total calculations in the TRB math
Calculations like
running_total = TRB_MAX_BUFF_SIZE -
(sg_dma_address(sg) & (TRB_MAX_BUFF_SIZE - 1));
if (running_total != 0)
num_trbs++;
are incorrect, because running_total can never be zero, so the if()
expression will never be true. I think the intention was that
running_total be in the range of 0 to TRB_MAX_BUFF_SIZE-1, not 1
to TRB_MAX_BUFF_SIZE. So adding a
running_total &= TRB_MAX_BUFF_SIZE - 1;
fixes the problem.
This patch should be queued for stable kernels back to 2.6.31.
Signed-off-by: Paul Zimmerman <paulz@synopsys.com>
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com>
Cc: stable@kernel.org
Diffstat (limited to 'virt')
0 files changed, 0 insertions, 0 deletions