Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 123205
b: refs/heads/master
c: a5ddde4
h: refs/heads/master
i:
  123203: cb958c3
v: v3
  • Loading branch information
Ian Campbell authored and Ingo Molnar committed Dec 17, 2008
1 parent 133fdfa commit faf01bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0016fdee927f7aa0f428494bcf11ae60c7470a02
refs/heads/master: a5ddde4a558b3bd1e3dc50e274a0db2ea7a8fd06
4 changes: 4 additions & 0 deletions trunk/lib/swiotlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,10 @@ map_single(struct device *hwdev, char *buffer, size_t size, int dir)
start_dma_addr = virt_to_bus(io_tlb_start) & mask;

offset_slots = ALIGN(start_dma_addr, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT;

/*
* Carefully handle integer overflow which can occur when mask == ~0UL.
*/
max_slots = mask + 1
? ALIGN(mask + 1, 1 << IO_TLB_SHIFT) >> IO_TLB_SHIFT
: 1UL << (BITS_PER_LONG - IO_TLB_SHIFT);
Expand Down

0 comments on commit faf01bc

Please sign in to comment.